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/04/01 09:31:49 UTC

Re: [transaction.locking] Modify the behaviour of the ReadWriteUpgradeLockManager

Hi,

Selon Oliver Zeigermann <ol...@gmail.com>:
> Hmmm, not quite sure that I get this all right, but to me it seems you
> describe the simple read/write locks (without the upgrade step). Is
> that possible? If so you could simply use the ReadWriteLockManager.

My lock manager has not exactly the same behaviour as the ReadWriteLockManager
and I think looks more like the ReadWriteUpgardeLockManager.

I will try to explain what I want to do ;o)

In my case :
* Read access requires a shared lock (S).
* Write access requires an exclusive lock (X).
* An upgrade lock (U) supports read with (potential) write access and prevents
further shared locks (S) for the same object. An upgrade lock (U) can be
converted to an exclusive lock (X) after the release of the existing shared
locks or back to a shared lock if no update action is needed (time out).

So, the difference is when I have an upgrade lock on a data, it is impossible to
obtain shared locks, but locks that are already granted keep going on. With the
exclusive lock no other locks can be obtained or exist on the same data.

I expect it's more clear?

Is it possible to transform the ReadWriteUpgradeLockManager to obtain this ?

Thanks for your help,

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] Modify the behaviour of the ReadWriteUpgradeLockManager

Posted by "Melanie.Bats@UTBM.fr" <Me...@utbm.fr>.
Hi,

Selon Oliver Zeigermann <ol...@gmail.com>:
> If so that's exactly what the read/write lock and then the read/write
> lock manager does.

Thanks this seems to be what I need.

Mel

> On Apr 1, 2005 6:30 PM, Oliver Zeigermann <ol...@gmail.com>
> wrote:
> > Still not quite clear, most likely because I am a bit dumb ;) What is
> > the use of your kind of upgrade lock? Or is it that you want
> > preference of the write lock over read locks, i.e. when more than one
> > party is waiting for a lock, the one waiting for the write lock gets
> > preference?
> >
> > Oliver
> >
> >
> > On Apr 1, 2005 9:31 AM, Melanie.Bats@UTBM.fr <Me...@utbm.fr> wrote:
> > > Hi,
> > >
> > > Selon Oliver Zeigermann <ol...@gmail.com>:
> > > > Hmmm, not quite sure that I get this all right, but to me it seems you
> > > > describe the simple read/write locks (without the upgrade step). Is
> > > > that possible? If so you could simply use the ReadWriteLockManager.
> > >
> > > My lock manager has not exactly the same behaviour as the
> ReadWriteLockManager
> > > and I think looks more like the ReadWriteUpgardeLockManager.
> > >
> > > I will try to explain what I want to do ;o)
> > >
> > > In my case :
> > > * Read access requires a shared lock (S).
> > > * Write access requires an exclusive lock (X).
> > > * An upgrade lock (U) supports read with (potential) write access and
> prevents
> > > further shared locks (S) for the same object. An upgrade lock (U) can be
> > > converted to an exclusive lock (X) after the release of the existing
> shared
> > > locks or back to a shared lock if no update action is needed (time out).
> > >
> > > So, the difference is when I have an upgrade lock on a data, it is
> impossible to
> > > obtain shared locks, but locks that are already granted keep going on.
> With the
> > > exclusive lock no other locks can be obtained or exist on the same data.
> > >
> > > I expect it's more clear?
> > >
> > > Is it possible to transform the ReadWriteUpgradeLockManager to obtain
> this ?
> > >
> > > Thanks for your help,
> > >
> > > 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] Modify the behaviour of the ReadWriteUpgradeLockManager

Posted by Oliver Zeigermann <ol...@gmail.com>.
If so that's exactly what the read/write lock and then the read/write
lock manager does.

Oliver

On Apr 1, 2005 6:30 PM, Oliver Zeigermann <ol...@gmail.com> wrote:
> Still not quite clear, most likely because I am a bit dumb ;) What is
> the use of your kind of upgrade lock? Or is it that you want
> preference of the write lock over read locks, i.e. when more than one
> party is waiting for a lock, the one waiting for the write lock gets
> preference?
> 
> Oliver
> 
> 
> On Apr 1, 2005 9:31 AM, Melanie.Bats@UTBM.fr <Me...@utbm.fr> wrote:
> > Hi,
> >
> > Selon Oliver Zeigermann <ol...@gmail.com>:
> > > Hmmm, not quite sure that I get this all right, but to me it seems you
> > > describe the simple read/write locks (without the upgrade step). Is
> > > that possible? If so you could simply use the ReadWriteLockManager.
> >
> > My lock manager has not exactly the same behaviour as the ReadWriteLockManager
> > and I think looks more like the ReadWriteUpgardeLockManager.
> >
> > I will try to explain what I want to do ;o)
> >
> > In my case :
> > * Read access requires a shared lock (S).
> > * Write access requires an exclusive lock (X).
> > * An upgrade lock (U) supports read with (potential) write access and prevents
> > further shared locks (S) for the same object. An upgrade lock (U) can be
> > converted to an exclusive lock (X) after the release of the existing shared
> > locks or back to a shared lock if no update action is needed (time out).
> >
> > So, the difference is when I have an upgrade lock on a data, it is impossible to
> > obtain shared locks, but locks that are already granted keep going on. With the
> > exclusive lock no other locks can be obtained or exist on the same data.
> >
> > I expect it's more clear?
> >
> > Is it possible to transform the ReadWriteUpgradeLockManager to obtain this ?
> >
> > Thanks for your help,
> >
> > 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


Re: [transaction.locking] Modify the behaviour of the ReadWriteUpgradeLockManager

Posted by Oliver Zeigermann <ol...@gmail.com>.
Still not quite clear, most likely because I am a bit dumb ;) What is
the use of your kind of upgrade lock? Or is it that you want
preference of the write lock over read locks, i.e. when more than one
party is waiting for a lock, the one waiting for the write lock gets
preference?

Oliver


On Apr 1, 2005 9:31 AM, Melanie.Bats@UTBM.fr <Me...@utbm.fr> wrote:
> Hi,
> 
> Selon Oliver Zeigermann <ol...@gmail.com>:
> > Hmmm, not quite sure that I get this all right, but to me it seems you
> > describe the simple read/write locks (without the upgrade step). Is
> > that possible? If so you could simply use the ReadWriteLockManager.
> 
> My lock manager has not exactly the same behaviour as the ReadWriteLockManager
> and I think looks more like the ReadWriteUpgardeLockManager.
> 
> I will try to explain what I want to do ;o)
> 
> In my case :
> * Read access requires a shared lock (S).
> * Write access requires an exclusive lock (X).
> * An upgrade lock (U) supports read with (potential) write access and prevents
> further shared locks (S) for the same object. An upgrade lock (U) can be
> converted to an exclusive lock (X) after the release of the existing shared
> locks or back to a shared lock if no update action is needed (time out).
> 
> So, the difference is when I have an upgrade lock on a data, it is impossible to
> obtain shared locks, but locks that are already granted keep going on. With the
> exclusive lock no other locks can be obtained or exist on the same data.
> 
> I expect it's more clear?
> 
> Is it possible to transform the ReadWriteUpgradeLockManager to obtain this ?
> 
> Thanks for your help,
> 
> 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