hi there,
Hibernate version: 2.1.5 and 2.1.6
Mapping documents:
<class
name="hibernate.test.Right"
table="TEST"
dynamic-update="true"
optimistic-lock="dirty"
>
<id name="atnr" column="ATNR" type="short">
<generator class="sequence">
<param name="sequence">atnr_sequence</param>
</generator>
</id>
....
</class>
Full stack trace of any exception that occurs:
11688 [Thread-0] DEBUG net.sf.hibernate.util.JDBCExceptionReporter - SQL Exception
java.sql.SQLException: The number of parameter values set or registered does not match the number of parameters.
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:325)
at com.ibm.as400.access.AS400JDBCPreparedStatement.commonExecuteBefore(AS400JDBCPreparedStatement.java:473)
at com.ibm.as400.access.AS400JDBCStatement.commonExecute(AS400JDBCStatement.java:599)
at com.ibm.as400.access.AS400JDBCPreparedStatement.executeUpdate(AS400JDBCPreparedStatement.java:949)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:684)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:642)
at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2418)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2372)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2240)
at hibernate.persistenz.DBAccess.run(DBAccess.java:58)
Name and version of the database you are using:
IBM DB2 on AS400 version V5R2M0
The generated SQL (show_sql=true):
update TEST set BEZ=? where ATNR=? and BEZ=?
i've tried the following (and exactly the same code works fine with version 2.1.3):
- 2 Threads reading the same entry from database
- 1 Thread waits 10 seconds and then tries to perform changes on that entry
- The second thread performs changes on database (changed one attribute) --> force concurrency-situation
==> exception
Sometimes the first thread works fine, but the second thread allways crashs ...
in the log i can see, that not all required parameters were set ... one or more "?" in the update-where-clause is still left :)
Is this a bug or are there some changes i didn't noticed?
A concurrency-handling via "version/timestamp" is not possible :(
thx!
curio
|