• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

B&S: Record Locking

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Thanks,
-Shaifque
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.

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 ]
reply
    Bookmark Topic Watch Topic
  • New Topic