aspose file tools*
The moose likes Threads and Synchronization and the fly likes Same method on the server called by two clients simultaneously Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Same method on the server called by two clients simultaneously" Watch "Same method on the server called by two clients simultaneously" New topic
Author

Same method on the server called by two clients simultaneously

Ziyang Zhang
Ranch Hand

Joined: Jul 17, 2010
Posts: 47
Same method on the server called by two clients simultaneously, will these two calls executes in 2 different thread and cause problems potentially?
I am now working on a project in which each client has a java client app on their local machine and they use the client app talk to the same server.
Client1 use create() method so he can get a reference of Bean1 on the server.
Client2 use create() method so he can get a reference of Bean1 on the server.
I didn't see there is any special code to keep only one Bean1 instance on the server side. So, I think each client has a reference to a different Bean1 object, right?
If each of them has a reference of Bean1 object on the server side, and they call a method called M1() simultaniously, it is possible that M1() of each Bean1 object execute in two thread on the server, right?
Thanks a lot,
Ziyang


Enjoy life!
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18138
    
  39


It's an implementation detail of your server. Or the service that you are using.

Without knowing what app/web server you are using, how you are calling the service, and how the service is written, we can't tell you what is happening... certainly not at the level of whether a client is accessing a particular reference to a bean or not.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Same method on the server called by two clients simultaneously
 
Similar Threads
How to put Unique Client Identity in Lock / unlock method
A bean in each ear .....
database and user interface running in the same VM
RMI, threads, locking unlocking records
NX: Locking and Unlocking and Sun's Must Conditions