In order to know which record transient vs persistent, I am using the last_update_timestamp.
Within the hibernate mapping file I have the following tag defined after the <id>:
<timestamp
name="lastUpdateTimestamp"
column="LAST_UPDATE_TIMESTAMP"
access="property"
unsaved-value="null"/>
When I call the save method for the object, I receive the exception below.
Hibernate version: Hibernate 2
Full stack trace of any exception that occurs:
2005-06-14 22:52:15,096 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - [IBM][CLI Driver] CLI0100E Wrong number of parameters. SQLSTATE=07001
2005-06-14 22:52:15,106 ERROR [net.sf.hibernate.impl.SessionImpl] - Could not synchronize database state with session
net.sf.hibernate.exception.SQLGrammarException: could not insert: [com.accenture.ruw.user.domain.UserCbo#61]
at net.sf.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:58)
at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at net.sf.hibernate.persister.AbstractEntityPersister.convert(AbstractEntityPersister.java:1331)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:472)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:436)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:37)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2450)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2436)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2393)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2262)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at com.accenture.ruw.test.TestUser2.execute(TestUser2.java:94)
at com.accenture.ruw.test.TestUser2.main(TestUser2.java:40)
Caused by: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0100E Wrong number of parameters. SQLSTATE=07001
at COM.ibm.db2.jdbc.net.SQLExceptionGenerator.throw_SQLException(Unknown Source)
at COM.ibm.db2.jdbc.net.SQLExceptionGenerator.check_return_code(Unknown Source)
at COM.ibm.db2.jdbc.net.SQLExceptionGenerator.check_return_code(Unknown Source)
at COM.ibm.db2.jdbc.net.DB2PreparedStatement.executeUpdate(Unknown Source)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:462)
... 9 more
Name and version of the database you are using: DB2 8.1
The generated SQL (show_sql=true):
Hibernate: insert into USER (LAST_UPDATE_TIMESTAMP, FIRST_NAME, LAST_NAME, LOGIN_NAME, EMAIL_ADDRESS, NATIONAL_FLAG, CREATED_BY, LEVEL_ID, LAST_UPDATED_BY, USER_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
_________________ Thank you for your assistance.
|