Hi All, I have a weird issue related to indentity columns in a DB2/400 table. In the topic below, the user was having basically the same issue, which seemed to point to a driver issue.
https://forum.hibernate.org/viewtopic.php?f=1&t=950850My problem is that this happens occasionally, and only after a new deployment if our app. I have been able to resolve this by just "touching and saving" the datasource config, and restarting the cluster. For whatever reason, the error then goes away, but I do not want to do this every time.
I am using:
Hibernate 3.2.6.ga
The connection url for the driver in hibernate config has "naming=system" (which I need to use because my tables are spread over multiple schemas).
Can anyone provide some hints as to why this occurs only after a new deployment, and why re-saving the datasource config resolves the issue, and maybe what I can do to prevent it in the future (naming=sql is not an option)?
Here is the specific error I receive (it's the '.' schema/table separator that causes the issue, with "naming=system" it is expecting "/":
[2/4/10 21:10:04:644 EST] 00000059 SystemOut O Hibernate:
select
identity_val_local()
from
sysibm.sysdummy1
[2/4/10 21:10:05:100 EST] 00000059 JDBCException E org.hibernate.util.JDBCExceptionReporter logExceptions [SQL5016] Qualified object name SYSDUMMY1 not valid.
[2/4/10 21:10:05:104 EST] 00000059 ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "createTagList" on bean "BeanId(NavigatorEAR#NavigatorServices.jar#ContactManagerImpl, null)". Exception data: org.hibernate.exception.SQLGrammarException: could not retrieve generated id after insert:
.....
.....
.....
Caused by: java.sql.SQLException: [SQL5016] Qualified object name SYSDUMMY1 not valid.
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:650)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:621)
at com.ibm.as400.access.AS400JDBCStatement.commonPrepare(AS400JDBCStatement.java:1576)
at com.ibm.as400.access.AS400JDBCPreparedStatement.<init>(AS400JDBCPreparedStatement.java:193)
at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:2023)
at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:1965)
at com.ibm.as400.access.AS400JDBCConnectionHandle.prepareStatement(AS400JDBCConnectionHandle.java:916)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.pmiPrepareStatement(WSJdbcConnection.java:1847)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:2086)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:2038)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:505)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:94)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:87)
at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:52)
... 59 more