commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "melanie.bats@utbm.fr" <Melanie.B...@utbm.fr>
Subject [transaction.locking] Looking for a ReadWriteUpgradeLockManager using example
Date Thu, 24 Mar 2005 08:30:59 GMT
Hi,

I'm a newbie with the transaction.locking package but I'm very interrested in
using the ReadWriteUpgradeLockManager class.

In my project, I need to use the lock manager as following : I have 3 locks
types( Shared, Exclusive, Update). Readers must obtain Shared locks, writers
must obtain Exclusive locks. If there are Shared locks on a data when a writer
wants to obtain an Exclusive lock, the writer obtain an Update lock on the
data. When the Update lock is obtained, it becomes impossible for readers to
obtain new shared locks on this data but the readers keep going on until the
end of their transactions. When all the readers free all the Shared locks on
the data, the Update lock becomes an Exclusive lock and this automatically.

This behaviour is more or less the same implemented in the
ReadWriteUpgradeLockManager class. If I well understand the mechanism, I need
to obtain first an Update lock and only when I ask for a write lock on the same
data I will obtain an Exclusive lock and readers can't obtain anymore Shared
locks on the data.

Is someone have an idea or an example to show me how to use the existing class
to obtain the good behaviour for my project ?

Thanks for all,

Mel


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message