The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Who's responsible for locking and concurrency? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "Who Watch "Who New topic
Author

Who's responsible for locking and concurrency?

Ronnie Phelps
Ranch Hand

Joined: Mar 12, 2001
Posts: 329
Should all locking responsibilities be controlled by the Data Base Server and all Concurrent access be controled by the NetworkProtocol?
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
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


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Who's responsible for locking and concurrency?
 
Similar Threads
calendar timezone
passed at 354
Design Question ( Data Access )
URLyBird : Locking in Data?
Problems using EL in WSAD