openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sutter <>
Subject Re: OpenJpa, and DB2 shared lock
Date Wed, 22 Apr 2009 13:40:34 GMT
Hi Chandra,
I don't have an answer for you yet, just more questions at this point...

o  What version of OpenJPA are you running with?

o  When you mention WAS v6.1, is this with or without the EJB3 Feature Pack?

o  The update scenario...  I'm assuming you are doing a find() operation on
an existing record.  Are you doing this within an EntityTransaction?  I'm
asking since if you are doing your update on this object while it is managed
(part of the current persistence context), then there is no need to do a
merge() operation.  The merge() is for bringing detached entities into a
persistence context (managed state).  Just a clarification, I don't think
this is causing the problem.

o  Are you setting any other openjpa.* properties?  Or, are you running with
the default runtime options?  For example, optimistic locking is the default
JPA mechanism, but OpenJPA also provides a pessimistic lock manager.  Any
additional information on your environment?

o  Off the top of my head, I am not aware of any retry logic within the
OpenJPA code.  If a transaction fails, I'm pretty sure that we just pass
that back to the app and let them deal with it.  Have you verified that your
app isn't accidentally retrying upon failure?  (Have to ask.)

o  Do you have more information on the exceptions received and any related
call stacks?  If not, the next step might be to turn on Trace and see what
processing is happening.

Good luck!

On Wed, Apr 22, 2009 at 4:22 AM, Chandra Sarath <> wrote:

> Hi,
> We use OpenJpa, DB2 and Websphere 6.1. We have created a Datasource in
> Websphere console that connects DB2 using a non-xa driver.
> We were testing our application about how it rolls back the data when there
> is a shared lock in a table. we have following scenarios. We have also set
> a
> Timeout of 30 seconds in Datasource/connection properties.
>  1. Insert a record in a read only (Shared lock).
>  2. Update a record in read only table (Shared lock).
>  For Scenario 1, after 30 seconds application times out and gives us proper
> error. But for scenario 2, it goes in infinite
>  loop and tries to update Database for every 30 secs, and it never stops
> trying to.
>  Is there any extra property that we need to set in Jpa level or Datasource
> level so application can timeout after 30 seconds?
>  we use entityManager.persist() for inserts and entityManager.merge() for
> updates. Can someone help us on this?
> Thank you!
> Chandra
> --
> View this message in context:
> Sent from the OpenJPA Users mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message