If an attempt is made to unlock a record that has not been locked by this connection, then no action is to be taken.
My doubt is this - "no action to be taken" means the client's booking itself (lock - book - unlock) must be invalidated OR the booking allowed but ignore the call to unlock?
Please take a look at my unreferenced code.
Is this correct?
.... A locks #13 followed by B, C, D
.... A does not unlock ....
.... B C D are put to wait ....
.... unreferenced called and the record unlocked ...
.... B, C, D proceed to lock and unlock the record one by one ...
Is this correct???
How do I verify if the same client locks and unlocks a record? I'm printing the connection object (unique) while locking and unlocking to verify? Please suggest a better way.
Andrew, CONGRATULATIONS!!! Just saw the post about your promotion. Very Happy to know that you will be the new bartender
1. Let me tell you how I make the unreferenced call -
I comment out A's unlock, and then make it call lock. So the server calls unreferenced after 10 min.
...(Here ofcourse, at times, I do set a leaseValue of 30000 for the job to be over soon)...
Then I send 3 concurrent threads B C D to do the locking and unlocking. They seem to go fine!!!
I don't get exceptions here. Any other probability of something wrong somewhere?
Also, in my application, I have a 'close' button, which nulls the remote reference and calls System.gc(). So my unreferenced is called immediately after every connected client clicks 'close'. In case the client
doesn't click close but exits by closing the window directly, then unreferenced is called after 10 minutes.
Is this correct?
Should I make my modify method also be aware of the calling object, so that no modification is done without a lock?
I got the ConcurrentModificationException
Is this correct, and do we have to clear all the locked records too,or enough just unlocking them?
2. Do we need to install a security manager?
3. I have a data object created in my factory and passed on to the connection object. So all connection objects get only one Data object. For my local access, I have a LocalDataImpl implementing RemoteIF, that creates a data object for local access. Is this acceptable?
... and a user guide like thing that describes and speaks of how to use the GUI etc.
Is this what is supposed to be as an "online" help HTML file?
The iterators returned by this class's iterator method are fail-fast: if the set is modified at any time after the iterator is created, in any way except through the iterator's own remove method, the Iterator throws a ConcurrentModificationException. Thus, in the face of concurrent modification, the iterator fails quickly and cleanly, rather than risking arbitrary, non-deterministic behavior at an undetermined time in the future.