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. -mike On Thu, Apr 14, 2011 at 12:06 PM, chintan4181 <[email protected]> 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: > http://openjpa.208410.n2.nabble.com/Version-for-sqlserver-timpstamp-datatype-tp6267241p6273590.html > Sent from the OpenJPA Users mailing list archive at Nabble.com. >
