File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes lock / unlock research Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "lock / unlock research " Watch "lock / unlock research " New topic

lock / unlock research

Gurpreet Saini
Ranch Hand

Joined: Jun 09, 2002
Posts: 295
Hi reader,
I am trying my client to call lock (Object ID, int record) but every time I call the remote class lock method the memeory of object ID changes from actual to something else ie for example if the actual Object is ClientID1234&45 then if I check this object on remote side then it becomes something like this way ClientID4343&34. This is very frustrating. Can you give me some hint why this is happening ?.
Thank you,
BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
It is being passed by copy, so a whole new object is being created server-side.
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
What you need is a way to identify a client on the serverside over different requests, so you can lock/unlock records on the server side for the right client.
There are several ways to do this, some depend on the communication protocol you use ...
think about it !

Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Gurpreet,
It's because you are using a stub on the client which will not have the same ID as the real object on the server, if you are using "this" as an ID.
Michael Morris

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
I agree. Here's the link:
subject: lock / unlock research
jQuery in Action, 3rd edition