-->
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.  [ 3 posts ] 
Author Message
 Post subject: DB2 390 Dialect and Sequences
PostPosted: Tue Oct 30, 2007 4:23 pm 
Newbie

Joined: Tue Oct 30, 2007 4:08 pm
Posts: 1
This happened on 3.2.0 and 3.2.5. I couldn't get Sequence to work with DB2 390 (Z/OS). Here is the exception:
com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -142, SQLSTATE: 42612, SQLERRMC: null

According to the DB2 doc, this means "The SQL Statement is not supported". Reviewed the error messages with the DBA, it looks like the SQL statement that Hibernate is trying to execute:

values nextval for <schema.sequence>

is supported for DB2 UDB on Windows and Linux, but on Z/OS it must be:

select next value for <schema.sequence> from sysibm.sysdummy1;

I think this is a bug. I got around it by extending DB2390Dialect and overriding the getSequenceNextValString() method:

public class DB2390DialectSequenceFix extends DB2390Dialect {

public String getSequenceNextValString(String sequenceName) {
return "select next value for " + sequenceName + " from sysibm.sysdummy1;";
}

}

_________________
Pete Zybrick


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 02, 2007 9:53 pm 
Newbie

Joined: Tue Sep 04, 2007 2:21 pm
Posts: 14
Pete,

Check your configuration, I am using a DB2/s390 and it works fine for me selecting from sysibm.sysdummy1.

Tom


Top
 Profile  
 
 Post subject: Re: DB2 390 Dialect and Sequences
PostPosted: Fri Nov 11, 2011 7:49 am 
Newbie

Joined: Sun Jun 25, 2006 6:48 am
Posts: 2
I confirm what PeteZybrick writes. Are there any differences in the DB2-Versions on z/OS? It's DB2 9 here.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.