]
Steve Ebersole commented on HHH-2605:
-------------------------------------
I presume you are talking about this code:
// add the primary key
if ( j == 0 && identityInsert ) {
insert.addIdentityColumn( getKeyColumns( 0 )[0] );
}
else {
insert.addColumns( getKeyColumns( j ) );
}
?
Well for the base tablle (j==0) of entities with an identity PK (identityInsert==true) we
call the special Insert#addIdentityColumn method. That method *conditionally* add the
identity column to the insert based on what the dialect says...
So, yes, I need a test case.
Since 3.2.4 no value specified for row id
-----------------------------------------
Key: HHH-2605
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2605
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.4
Environment: hibernate-3.2.4
mysql-5.0.27-1.fc6
mysql-connector-java-5.0.5-bin.jar
Reporter: Igor A Tarasov
Problem starts in 3.2.4 version, but in 3.2.3 was all right.
Row ID column is specified as parameter in query, but no value is specified.
Row ID column is autoincrement in MySQL tabled.
10.05.07 14:26:29 DEBUG [btpool0-0]: SQL - insert into PaymentDO (_version, comment,
created, customer_id, nalichka, newBalance, payDate, sum, id) values (?, ?, ?, ?, ?, ?, ?,
?, ?)
10.05.07 14:26:29 TRACE [btpool0-0]: AbstractBatcher - preparing statement
10.05.07 14:26:29 TRACE [btpool0-0]: AbstractEntityPersister - Dehydrating entity:
[org.dicr.isp.data.PaymentDO#<null>]
10.05.07 14:26:29 TRACE [btpool0-0]: LongType - binding '0' to parameter: 1
10.05.07 14:26:29 TRACE [btpool0-0]: StringType - binding null to parameter: 2
10.05.07 14:26:29 TRACE [btpool0-0]: TimestampType - binding '2007-05-10
14:26:29' to parameter: 3
10.05.07 14:26:29 TRACE [btpool0-0]: VersionValue - version unsaved-value strategy
UNDEFINED
10.05.07 14:26:29 TRACE [btpool0-0]: IdentifierValue - id unsaved-value: 0
10.05.07 14:26:29 TRACE [btpool0-0]: LongType - binding '18128' to parameter: 4
10.05.07 14:26:29 TRACE [btpool0-0]: BooleanType - binding 'false' to parameter:
5
10.05.07 14:26:29 TRACE [btpool0-0]: FloatType - binding '3.0' to parameter: 6
10.05.07 14:26:29 TRACE [btpool0-0]: TimestampType - binding '2007-05-10
00:00:00' to parameter: 7
10.05.07 14:26:29 TRACE [btpool0-0]: FloatType - binding '3.0' to parameter: 8
10.05.07 14:26:29 DEBUG [btpool0-0]: AbstractBatcher - about to close PreparedStatement
(open PreparedStatements: 1, globally: 1)
10.05.07 14:26:29 TRACE [btpool0-0]: AbstractBatcher - closing statement
10.05.07 14:26:29 DEBUG [btpool0-0]: JDBCExceptionReporter - could not insert:
[org.dicr.isp.data.PaymentDO] [insert into PaymentDO (_version, comment, created,
customer_id, nalichka, newBalance, payDate, sum, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?)]
java.sql.SQLException: No value specified for parameter 9
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
at com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:1674)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1512)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1455)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1440)
at
org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:73)
at
org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:33)
at
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2158)
at
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2638)
at
org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
at
org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298)
at
org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
at
org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
at
org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49)
at
org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131)
at
org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87)
at
org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:618)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:592)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:596)
at
org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:213)
at org.dicr.isp.data.HibernateDataManager.createPayment(HibernateDataManager.java:692)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: