You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "melanie.bats@utbm.fr" <Me...@utbm.fr> on 2005/03/24 09:30:59 UTC

[transaction.locking] Looking for a ReadWriteUpgradeLockManager using example

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


Re: [transaction.locking] Looking for a ReadWriteUpgradeLockManager using example

Posted by "melanie.bats@utbm.fr" <Me...@utbm.fr>.
Hi,

Selon Oliver Zeigermann <ol...@gmail.com>:

> Everything you describe seems to be right to me.

Ok.

Do you have an example where you use the ReadWriteUpgradeLockManager? It could
help me in my project.

Thanks,

Mel

> On Thu, 24 Mar 2005 09:30:59 +0100, melanie.bats@utbm.fr
> <Me...@utbm.fr> wrote:
> > 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
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>



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


Re: [transaction.locking] Looking for a ReadWriteUpgradeLockManager using example

Posted by Oliver Zeigermann <ol...@gmail.com>.
Everything you describe seems to be right to me.

Oliver


On Thu, 24 Mar 2005 09:30:59 +0100, melanie.bats@utbm.fr
<Me...@utbm.fr> wrote:
> 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
> 
>

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