[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Transactions and locking



On Wed, 10 May 2000, Rajiv Rawal wrote:
> OK here goes the scenario.
> 
> We load the document / fragment the result of a query into an in-memory
> version. At this point we may want to lock the document in the database on a
> specific level (Read only if no updates are going to be made) or (Write lock
> if we don't want another user to read as well). Also need to provide some
> time out functionality so that if the user holds on to the lock for too
> long. The user then writes the in memory document / fragment back to the
> database.

The problem is that XML nodes are just to small - the ordinary ozone
single-instance architecture is not very suited for many typical XML apps. It
isn't possible to control them via RMI because of performance reasons. This
leads to such in-memory vs in-database hacks which introduce exactly the same
replication problems that we wanted to avoid with ozone.

Anyway, I'm not sure if you really need explicite locks to synchronize your
in-memory and in-database version of the document. When you access the document
to make the in-memory version a READ lock is set. To set also a WRITE lock just
call an update method of the document. When the user is done with the document
he/she may writes something back to the db and commits the entire transaction.


Falko
-- 
______________________________________________________________________
Falko Braeutigam                         mailto:falko@softwarebuero.de
softwarebuero m&b (SMB)                    http://www.softwarebuero.de