-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Issues with optimistic locking get SQLException *File in use
PostPosted: Fri Apr 15, 2011 11:05 am 
Newbie

Joined: Fri Apr 15, 2011 10:14 am
Posts: 1
I am using hibernates implementation of JPA 1, using a Version column for optimistic locking.

When reading and updating the same row from a GUI I successfully receive an optimistic locking exception. When I run concurrent threads through a webservice for the same rows I get the stack trace below..

Code:
Caused by: java.sql.SQLException: [SQL0913] Row or object [TABLE NAME] in [DB SCHEMA] type *FILE in use.
   at com.ibm.as400.access.JDError.throwSQLException(JDError.java:645)
   at com.ibm.as400.access.JDError.throwSQLException(JDError.java:616)
   at com.ibm.as400.access.AS400JDBCStatement.commonExecute(AS400JDBCStatement.java:915)
   at com.ibm.as400.access.AS400JDBCPreparedStatement.executeQuery(AS400JDBCPreparedStatement.java:1154)
   at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.pmiExecuteQuery(WSJdbcPreparedStatement.java:1031)
   at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.executeQuery(WSJdbcPreparedStatement.java:681)
   at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
   at org.hibernate.loader.Loader.getResultSet(Loader.java:1808)
   at org.hibernate.loader.Loader.doQuery(Loader.java:697)
   at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
   at org.hibernate.loader.Loader.doList(Loader.java:2228)
   ... 75 more


Surely if I am using optimistic locking the row should not be in use? Am I missing a setting that tells the DB not to lock the rows?

Hibernate 3.3.1
JPA 1
AS400 iSeries
I am using an isolation level of READ_COMMITTED, hibernate.connection.isolation = 2, can this be related? I would have thought the second thread would wait for the first thread to commit rather than return the above error.

Any guidance would be gladly received.

Regards,


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.