?
Solved

C# .Net Remoting, sessions?

Posted on 2009-04-02
2
Medium Priority
?
1,074 Views
Last Modified: 2013-11-07
I am writing a system using .Net Remoting, and need abit of advice on how possible it is to create a server that will manage each connected client in the same session.

I have 3 elements, my shared DLL (with all the functions the server is sharing), my actual server (to host the dll), and a client GUI form that calls the functions in the DLL.

My issue is, I am connecting to an SQL database, and returning data from 3 seperate tables within the same dataset. What i'm finding is, when I interregate the first and second table, the data for each is returned and stored in its own table within the same dataset. If i then interregote the first table again, the object seems to have been released and doesn't exist anymore.

What i'm trying to achieve is:

Server (hosted DLL) connects to database and populates a dataset contaning 3 seperate tables. Each client will then connect to this server object, and manipulate the data within the dataset (im trying to avoid lots and lots of SQL database requests). But it appears as if everytime i call on a function on the server, all the objects are released from memory straight away, as if the entire DLL has re-declared itself as a seperate instance. I have set the hosting mode to "Singleton" when initiating the server, so I thought that would have been enough?

Is it possibe to do what I am trying to achieve with .Net Remoting?

Thanks in advance,
Dez
// The code the server uses to host the DLL (note the Singleton mode)
 
            TcpChannel chan = new TcpChannel(9932);
            ChannelServices.RegisterChannel(chan, false);
            RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemoteInfo), "TheServerReference", WellKnownObjectMode.Singleton);

Open in new window

0
Comment
Question by:DjDezmond
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
Mihai Stancescu earned 400 total points
ID: 24084307
First: why don't you try WCF it is more advanced and better than .Net Remoting?
Second: here's a link that might help you: http://social.msdn.microsoft.com/Forums/en-US/netfxremoting/thread/9e755c87-4314-410f-9861-5b407665298f

Hope this helps!

Regards,
Mishu
0
 
LVL 9

Author Comment

by:DjDezmond
ID: 24086599
Hi thanks for the response.

I did look into the WCF framework, but i can only guarentee the environment i'm developing in has at least .net 2.0 installed. Most machines will have 3.0, but it's not guarenteed. As I finish the prototype, I will look into WCF more thoroughly.

As for my original question, I had actually realised that the issue I was experiencing was actually due to my own mistake of closing and disposing the database object after every database call, which I have now resolved. but any information being posted would also help me to understand how .net remoting structures its objects in respect of multiple clients connecting, would they use the same object instance (and thus the same database connection)? or would they each have their own (so I could potentially have multiple clients using seperate connections to the database, creating syncronisation issues). But i think your link will pretty much answer all of that, so thanks.

Points awarded to you young sir. Thanks again :)

Dez
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question