-->
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.  [ 2 posts ] 
Author Message
 Post subject: DB2/400 and getGeneratedKeys()
PostPosted: Fri Feb 05, 2010 10:52 am 
Newbie

Joined: Fri Jul 10, 2009 12:15 pm
Posts: 6
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=950850

My 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


Top
 Profile  
 
 Post subject: Re: DB2/400 and getGeneratedKeys()
PostPosted: Fri Oct 08, 2010 11:49 am 
Newbie

Joined: Fri Jul 10, 2009 12:15 pm
Posts: 6
Hi All, sorry to bump this back up to the top, but...
I posted this earlier in the year and got no responses. It is still an outstanding for us, so I just wanted to try my chances of getting any help today.

Thanks.
Kevin..


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

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.