[Objectbridge-developers] Reader/Writer Locks and other such stuff
Brought to you by:
thma
From: Dixon-Peugh, D. <Dav...@tp...> - 2000-12-01 21:13:59
|
Good evening. I've been doing some work on ObJectBridge, and have made some further progress. First a note on CVS. When I tried to connect to CVS from home, I was unable to get to the "ojb" directory of ObJectBridge. I dropped some work into the "objectbridge" directory. I've moved just about everything that has been updated to "objectbridge" from "ojb" (as I can get to both at work, but only one at home.) Now, as for the changes: ojb.server.ReaderWriterLock - This class implements a ReaderWriterLock on an object. Unfortunately, we cannot enforce this lock (its up to the user to do that.) There are basically a couple of APIs: read( Trans ) write( Trans ) upgrade( Trans ) release( Trans ) Right now, the locks are maintained in the TransactionImpl (wrong place, should probably be in a LockManager or such.) ojb.server.ObjectTransactionWrapper - This class maintains the state of a persistent object at the begining and end of a transaction. When the wrapper is aborted, the persistent fields of the object are restored to what they were at the begining of the transaction. ojb.server.TransactionImpl - This class has been modified to use the Reader/Writer locks as apropriate. It has also been modified to build ObjectTransactionWrapper around all objects that a WRITE lock is acquired on. It has been modified to have ObjectTransactionWrapper commit/abort where apropriate. ojb.server.TransactionAware - This is an interface that the end-user can implement. With the TransactionAware iface, you can kill a transaction which involves your object. You can also clean up in the event of an abort. Share and Enjoy! David. |