It was URLyBird assignment.
I did have a prior experience in writing multithreaded and networked applications, which apparently helped (never did a gui, which also showed up in the final score).
Locking: most importantly, locking was separated from databse operations, which made the locking api clean and simple for use and implementation. SCJD forum has many threads discussing the locking. I did not see any need for complicated solution (i.e.
Java 5 new locking api), and simplistic synchronized Map was quite enough. Basicly, the whole locking was reduced to two operations on a lock manager:
1. get a lock (object) for a given recid. this blocks if id is already locked till it becomes available.
2. destroy obtained lock object (which means unlocking of the corresponding record)
I do not think I can go in much more detail without giving up the actual implementation. Basically, my advise would be to keep it simple (which has an added benefit of making less room for bugs, which can be very obscure in a multithreaded code).
Thanks you guys, and good luck.
Again, its a gread place, and very helpful forum.
-Mike