This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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,
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.