You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Valentin Kulichenko <va...@gmail.com> on 2015/11/24 01:09:21 UTC

Explicit lock inside a transaction

Igniters,

Do we allow to acquire explicit locks (cache.lock(..) method) within an
explicit transaction? Currently it doesn't work which makes me think that
it's an invalid usage, but it fails with NPE [1]. Do we need to fix it or
just provide proper message?

[1] https://issues.apache.org/jira/browse/IGNITE-1988

-Val

Re: Explicit lock inside a transaction

Posted by Dmitriy Setrakyan <ds...@apache.org>.
On Tue, Nov 24, 2015 at 9:15 AM, Vladimir Ozerov <vo...@gridgain.com>
wrote:

> I do not think it should be analogous to "get". Get creates implicit lock
> which is released when transaction ends. Lock is obtained explicitly and
> should be released explicitly as well.
>

Hm… I guess I didn’t think it through. I agree, then we should not support
explicit locks within transactions, so no changes to current behavior.
Let’s just fix the NPE then.


> On Tue, Nov 24, 2015 at 3:34 AM, Dmitriy Setrakyan <ds...@apache.org>
> wrote:
>
> > It is currently not supported, but it should not throw an NPE. To be
> > honest, I am not sure why we don’t support it. IMHO, it should be
> analogous
> > to a get() call which returns no value.
> >
> > Can anyone shed some light on this?
> >
> > D.
> >
> > On Tue, Nov 24, 2015 at 3:09 AM, Valentin Kulichenko <
> > valentin.kulichenko@gmail.com> wrote:
> >
> > > Igniters,
> > >
> > > Do we allow to acquire explicit locks (cache.lock(..) method) within an
> > > explicit transaction? Currently it doesn't work which makes me think
> that
> > > it's an invalid usage, but it fails with NPE [1]. Do we need to fix it
> or
> > > just provide proper message?
> > >
> > > [1] https://issues.apache.org/jira/browse/IGNITE-1988
> > >
> > > -Val
> > >
> >
>

Re: Explicit lock inside a transaction

Posted by Vladimir Ozerov <vo...@gridgain.com>.
I do not think it should be analogous to "get". Get creates implicit lock
which is released when transaction ends. Lock is obtained explicitly and
should be released explicitly as well.

On Tue, Nov 24, 2015 at 3:34 AM, Dmitriy Setrakyan <ds...@apache.org>
wrote:

> It is currently not supported, but it should not throw an NPE. To be
> honest, I am not sure why we don’t support it. IMHO, it should be analogous
> to a get() call which returns no value.
>
> Can anyone shed some light on this?
>
> D.
>
> On Tue, Nov 24, 2015 at 3:09 AM, Valentin Kulichenko <
> valentin.kulichenko@gmail.com> wrote:
>
> > Igniters,
> >
> > Do we allow to acquire explicit locks (cache.lock(..) method) within an
> > explicit transaction? Currently it doesn't work which makes me think that
> > it's an invalid usage, but it fails with NPE [1]. Do we need to fix it or
> > just provide proper message?
> >
> > [1] https://issues.apache.org/jira/browse/IGNITE-1988
> >
> > -Val
> >
>

Re: Explicit lock inside a transaction

Posted by Dmitriy Setrakyan <ds...@apache.org>.
It is currently not supported, but it should not throw an NPE. To be
honest, I am not sure why we don’t support it. IMHO, it should be analogous
to a get() call which returns no value.

Can anyone shed some light on this?

D.

On Tue, Nov 24, 2015 at 3:09 AM, Valentin Kulichenko <
valentin.kulichenko@gmail.com> wrote:

> Igniters,
>
> Do we allow to acquire explicit locks (cache.lock(..) method) within an
> explicit transaction? Currently it doesn't work which makes me think that
> it's an invalid usage, but it fails with NPE [1]. Do we need to fix it or
> just provide proper message?
>
> [1] https://issues.apache.org/jira/browse/IGNITE-1988
>
> -Val
>