dcsimg
How can every client launch diferent methods in the same server
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   David_Aldavero
Posted On:   Monday, December 6, 2004 10:03 AM

The problem is: I have a CORBA server with the tipical public methods: * setparameters() * doaction() But what if two clients connect at same time in this sequence: 1. Client 1: setparameters(1); 2. Client 2: setparameters(2); 3. Client 1: doaction(); 4. Client 2: doaction(); Both clients executed "doaction" whith parameter 2, however client 1 set a 1 in parameters. Something similar is happening in my server. In adittion, my "doaction" method is very large, and if it's invoked 2 times, it results in errors. I suppose the solution could be that every client create a new diferent obje   More>>

The problem is: I have a CORBA server with the tipical public methods:


* setparameters()

* doaction()


But what if two clients connect at same time in this sequence:


1. Client 1: setparameters(1);

2. Client 2: setparameters(2);

3. Client 1: doaction();

4. Client 2: doaction();


Both clients executed "doaction" whith parameter 2, however client 1 set a 1 in parameters.


Something similar is happening in my server. In adittion, my "doaction" method is very large, and if it's invoked 2 times, it results in errors.


I suppose the solution could be that every client create a new diferent object in the server, so every client interact with diferent objects, but I don`t know how to do this.


Please help me. Thanks.
David.

   <<Less

Re: How can every client launch diferent methods in the same server

Posted By:   Anonymous  
Posted On:   Tuesday, December 7, 2004 07:59 AM

I suppose the solution could be that every client create a new diferent object in the server, so every client interact with diferent objects, but I don`t know how to do this.

There are other solutions but if you don't want to break your entire interface this is a good solution, and your clients will have to make only minor change in code.


See this presentation by Duncan Grisby (OmniORB) for a good example of using the Factory Pattern. It's written in Python. Also see Michi Henning and Steve Vinoski's Advanced CORBA Programming in C++ for that and other useful examples and patterns.

About | Sitemap | Contact