openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dick <>
Subject Re: @Version for sqlserver "timpstamp" datatype
Date Thu, 14 Apr 2011 17:34:59 GMT
Hi Chintan,

We're getting a LockTimeoutException from SQLServer, which is why you're
seeing a different exception.

OpenJPA handles locking on SQLServer a little differently from other
databases. Instead of a FOR UPDATE clause we obtain a table lock.

It would be most helpful if you could enable logging for SQL and JDBC :
<property name="openjpa.Log" value="SQL=TRACE,JDBC=TRACE"/>

In the trace file look for an instance of "WITH (UPDLOCK)" . If that's
present, OpenJPA has locked the table (e.g. pessimistic locking). If it
isn't found in the trace then it may be a case of implicit locking due to
your isolation level.

Providing your persistence.xml (pastebin if possible) may be a big help in
either case.


On Thu, Apr 14, 2011 at 12:06 PM, chintan4181 <> wrote:

> Few more details: Loan object has one-to-one relation with other object and
> i
> have already queried parent object which contains loan object.
> so Parent p = em.find(Parent.class, pId);
> Loan loan = p.getLoan();
> //setting loan values
> //lock loan object with optimistic lock
> //persist it.
> --
> View this message in context:
> Sent from the OpenJPA Users mailing list archive at

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