-->
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: Error using dynamic-update='true
PostPosted: Tue Oct 05, 2004 9:59 am 
Expert
Expert

Joined: Tue Oct 05, 2004 9:45 am
Posts: 263
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


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.