-->
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.  [ 4 posts ] 
Author Message
 Post subject: SQLException "Sequence not found" doesn't show seq
PostPosted: Sun Jul 24, 2005 5:25 pm 
Newbie

Joined: Sun Jul 24, 2005 5:16 pm
Posts: 1
Location: Estonia, Tallinn
When SQLException "Sequence is not found" occurs, it doesn't show name of sequence.

Particularly, I have found this line in Hibernate source code:
this.sequenceName = PropertiesHelper.getString(SEQUENCE, params, "hibernate_sequence");

Hibernate tries to find sequence "hibernate_sequence" which of couse doesn't exist in my database. It would be better if Hibernate figured out exact name of sequence.

Hibernate version: 3.0.5

Mapping documents:

The generated SQL (show_sql=true):
select hibernate_sequence.nextVal from dual

_________________
Andrei Solntsev,
Estonia, Tallinn


Top
 Profile  
 
 Post subject: sequnce problem
PostPosted: Mon Jul 25, 2005 4:21 pm 
Newbie

Joined: Mon Jul 11, 2005 5:55 pm
Posts: 2
You can put the sequence name in the hbm file itself to ask hibernate to use the sequence name given by you , which exists in your adtabase


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 25, 2005 5:28 pm 
Regular
Regular

Joined: Thu Oct 07, 2004 4:45 pm
Posts: 92
If you have Hibernate generate the schema for you, there will be a sequence called "hibernate_sequence", assuming you're using sequence-based IDs and you don't override this default name.

In any case, you can debug problems like this by turning on SQL logging as described in the reference doc.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 02, 2005 3:08 pm 
Newbie

Joined: Wed Dec 08, 2004 12:28 pm
Posts: 8
Hi asolntsev,

If you have to use definited sequences in Hibernate just do so.

<id
name="id"
column="KONTO_ID"
type="java.lang.Long"
unsaved-value="null"
>
<generator class="native"> <!-- native is the generator -->
<!-- parameter-name:= sequence -->
<!-- Sequence definition in Oracle "BS_KONTO_SEQ" -->
<param name="sequence">BS_KONTO_SEQ</param>
</generator>
</id>


let try !


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