Skip to Content
0
Former Member
May 13, 2008 at 02:01 PM

Java RMI question

68 Views

Hey guys...

I have got a theoretical question about RMi and Java...

Do I have to implement any synchronizations on the server side?

I'm not sure but... RMI does the whole socket communication stuff... so if a client gets a Stub-Instance of my ServerImplementation object the client is possible to call functions on the server side. (Client --> RMI Stub --> RMI Skeleton --> Server)

If there is only one client... I do not see any problems.

But what if there would be more than one client. Maybe 10. And every client tries to execute the same server function at the same time.

And the server function does some operations which needed to be synchronous. (withdraw or deposit some cash for example).

In my opinion it is only possible to execute one server function at different times. Never at the same time. Of course there could be many connections at the same time, but there is only one existing server implementation instance running. So if one Sekeleton calls the Server function it should be automatically lock the server implementation object and the other clients are not allowed to execute server functions.

Am I right with this thing?

May you help me clarifying this theoretical question.

Thanks and regards

Markus