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: Cannot find sequence
PostPosted: Tue Mar 06, 2007 6:14 pm 
Newbie

Joined: Fri Dec 02, 2005 12:43 pm
Posts: 6
Location: New York, NY
Hibernate version: 3.2

I am trying to assign the id using Oracle sequence.

i have this xml mapping:

...
<class name="MyObject" table="My_TABLE">
<id name="id" column="ID" type="long" unsaved-value="null">
<generator class="sequence">
<param name="sequence">MY_SEQ</param>
</generator>
</id>
...

Hibernate properties:
<prop key="hibernate.default_schema">MySchema</prop>

When loading my xml mapping files, I'm getting this exception:

Caused by: org.hibernate.HibernateException: Missing sequence or table: MySchema.MY_SEQ

All the other tables work fine with that assigned schema. And when I execute this sql, the object is find correctly:
SELECT MySchema.MY_SEQ.CURRVAL
FROM dual;

Any ideas?

Thanks,
Gabriel


Top
 Profile  
 
 Post subject: this is weird
PostPosted: Tue Mar 06, 2007 6:22 pm 
Newbie

Joined: Fri Dec 02, 2005 12:43 pm
Posts: 6
Location: New York, NY
I just deactivated next property and it works. Do not know why though.

<!--prop key="hibernate.hbm2ddl.auto">validate</prop-->


Top
 Profile  
 
 Post subject: Re: this is weird
PostPosted: Tue Mar 13, 2007 4:43 pm 
Newbie

Joined: Wed Mar 07, 2007 11:27 pm
Posts: 3
gabs79 wrote:
I just deactivated next property and it works. Do not know why though.

<!--prop key="hibernate.hbm2ddl.auto">validate</prop-->


I have encountered the same error when using Oracle & JBoss Seam. Problem is, the property hibernate.hbm2ddl.auto already seems to be disabled. I posted the problem in a separate thread but no response yet:

http://forum.hibernate.org/viewtopic.php?t=971878&highlight=hibernateexception+sequence

I would really like to continue with Seam/Hibernate but this is a roadblock...


Top
 Profile  
 
 Post subject: More Detail
PostPosted: Mon Jan 28, 2008 2:09 pm 
Newbie

Joined: Mon Jan 28, 2008 2:03 pm
Posts: 1
On Oracle 10g and Hibernate 3.2.5.ga

I seem to have this problem only if I am trying to use a sequence that is in a schema other than the login user's own schema. It works fine if I use the login user's own schema.

Also, if I use hibernate.hbm2ddl.auto = update it seems to work.

I hope this is somehow helpful.

Thanks,
Ernie


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.