PESSMISTIC_READ takes out exclusive lock on Postgres

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

PESSMISTIC_READ takes out exclusive lock on Postgres

pveselov
Hello.

I've found out that using PESSIMISTIC_READ on an entity with postgres
uses 'for update' lock, which is actually exclusive.

I understand JPA specification says that it's permissible to do that,
but I really need a shared lock for what I'm trying to achieve.

Is it possible to control somehow? I've had to resolve to using native
queries, and I'd like to avoid this as much as possible...

Thank you!
  Pawel.

--
With best of best regards
Pawel S. Veselov
Reply | Threaded
Open this post in threaded view
|

Re: PESSMISTIC_READ takes out exclusive lock on Postgres

Mark Struberg-3
Hi Pawel!

Would need to dig deeper. Can you possibly please create a JIRA ticket for OPENJPA?
So we can better track this!

Thanks!

LieGrue,
strub


> Am 20.02.2020 um 18:22 schrieb Pawel Veselov <[hidden email]>:
>
> Hello.
>
> I've found out that using PESSIMISTIC_READ on an entity with postgres
> uses 'for update' lock, which is actually exclusive.
>
> I understand JPA specification says that it's permissible to do that,
> but I really need a shared lock for what I'm trying to achieve.
>
> Is it possible to control somehow? I've had to resolve to using native
> queries, and I'd like to avoid this as much as possible...
>
> Thank you!
>  Pawel.
>
> --
> With best of best regards
> Pawel S. Veselov

Reply | Threaded
Open this post in threaded view
|

Re: PESSMISTIC_READ takes out exclusive lock on Postgres

pveselov
Hello.

https://issues.apache.org/jira/browse/OPENJPA-2806

On Mon, Feb 24, 2020 at 10:58 PM Mark Struberg
<[hidden email]> wrote:

>
> Hi Pawel!
>
> Would need to dig deeper. Can you possibly please create a JIRA ticket for OPENJPA?
> So we can better track this!
>
> Thanks!
>
> LieGrue,
> strub
>
>
> > Am 20.02.2020 um 18:22 schrieb Pawel Veselov <[hidden email]>:
> >
> > Hello.
> >
> > I've found out that using PESSIMISTIC_READ on an entity with postgres
> > uses 'for update' lock, which is actually exclusive.
> >
> > I understand JPA specification says that it's permissible to do that,
> > but I really need a shared lock for what I'm trying to achieve.
> >
> > Is it possible to control somehow? I've had to resolve to using native
> > queries, and I'd like to avoid this as much as possible...
> >
> > Thank you!
> >  Pawel.

[ skipped ]