Hi There, I read many posts about record locking where people talked about "Locking Manager" which seems a/some class(es). Of course, we don't need locking in "alone" mode. I am using a simple hash map data structure which stores record number as key object and client info as value object. This map resides in the db access file which handles all requests from different clients. Only one object of this class is created. I wonder this aproach may not be good in terms of future enhancments, code understanding etc. Please comment and kindly let me know if there is a better approach like how to think about writing a locking manager.
posted 9 years ago
By "client info as value object" you mean the lock cookie, right? Because that is IMHO all "client info" you need.
I also use an extra Object (only once created) to manage my locks in a multi threaded environment. That has to be the way to achieve a high cohesion in your code.
After some tests, I got an good feeling about that.
Best Regards R
[ January 23, 2007: Message edited by: Rudolph Jen ] [ January 23, 2007: Message edited by: Rudolph Jen ]