-->
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.  [ 8 posts ] 
Author Message
 Post subject: Hibernate Sequence and Oracle 8i
PostPosted: Mon Jan 05, 2004 8:35 am 
Newbie

Joined: Mon Jan 05, 2004 8:22 am
Posts: 2
Location: Overland Park, KS
Has anyone else had issue with Hibernate & Oracle 8i sequences? (We run 8i because our client does). Most of the time our sequences work fine defined as shown below:

CREATE SEQUENCE STATE_ID
INCREMENT BY 1
START WITH 1
MINVALUE 1
MAXVALUE 214748647
ORDER

At one time the client DBA created the sequences with no minimum, no maximum and no order, which was a real mess. That is why we set them explicitly now.

The problem is that occasionally when we set up a new Oracle DB the limits seem to be ignored. The last time this happened I corrected the problem by restarting Oracle. In my newest created environment at home I am getting IDs like: -1.000E+64, 8.3000E+83, 8.5000E+59. When I SELECT * FROM USER_SEQUENCES is see that LAST_NUMBER is 21, not the huge exponential number shown above.

Any ideas what causes this behavior?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 27, 2004 5:30 pm 
Newbie

Joined: Wed Sep 17, 2003 9:02 pm
Posts: 13
I am using Hibernate to get the last value of Oracle 8i sequence and I do not encounter problems like you have mentioned.

The statement I use id "select sequence_name.nextval from dual". Give this a try please.


Top
 Profile  
 
 Post subject: Oracle Driver Issue
PostPosted: Tue Jan 27, 2004 7:44 pm 
Newbie

Joined: Mon Jan 05, 2004 8:22 am
Posts: 2
Location: Overland Park, KS
The SQL was all correct. It was generated by Hiberante & Xdoclet using the generator-class. In the SQL log we could see that the correct sequence number was in the Insert statement, and we could also see the correct sequence number in the ID field of the object.

In the end, I think the problem was cause by using OracleDialect with the Oracle 9i driver. One of the developers had both the 9i and 8i drivers in their classpath. Once that was fixed the problem went away.


Top
 Profile  
 
 Post subject: how to access the oracle seuence
PostPosted: Thu Jan 29, 2004 2:16 pm 
Newbie

Joined: Sun Nov 09, 2003 12:34 pm
Posts: 15
Hi Stevem/kk,

How can you guys access the oracle sequence from hibernate. I only want to get the nextval from the sequence.

thanks,


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2004 6:13 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Have a look at the dialect and id packages in the src code.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 11, 2004 8:57 am 
Newbie

Joined: Fri Feb 20, 2004 10:55 am
Posts: 13
I'm having the same problem. Any news about?


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 11, 2004 9:00 am 
Newbie

Joined: Fri Feb 20, 2004 10:55 am
Posts: 13
I'm having the same problem. Any news about?


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 17, 2004 2:39 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Same solution
Quote:
Have a look at the dialect and id packages in the src code.

_________________
Emmanuel


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