• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Who's responsible for locking and concurrency?

 
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Should all locking responsibilities be controlled by the Data Base Server and all Concurrent access be controled by the NetworkProtocol?
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ronnie,


Should all locking responsibilities be controlled by the Data Base Server and all Concurrent access be controled by the NetworkProtocol?


I'm not real sure what your getting at here. First of all are you using RMI or sockets? In my implementation, concurrent access (in regards to modification) of the Data object was ultimately controlled by the remote connection object. When the client called dataAccess.modify(), the remote connection object first called lockManager.isRecordLocked(this, record) before calling data.modify(). If isRecordLocked() returned false then the remote object threw a DatabaseException. So really I suppose the LockManager and the remote object worked in concert to protect Data from concurrent modification.
Hope this helps,
Michael Morris
 
reply
    Bookmark Topic Watch Topic
  • New Topic