-->
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.  [ 1 post ] 
Author Message
 Post subject: HibernateException: Missing sequence or table
PostPosted: Wed Mar 07, 2007 11:38 pm 
Newbie

Joined: Wed Mar 07, 2007 11:27 pm
Posts: 3
Hello:

I posted this in the Seam forum and someone suggested I post here...

I'm trying to deploy a Seam 1.2 (Hibernate 3.2.0, Oracle DB) app that uses an entity bean to persist data. For some reason, when I deploy, I get the following exception:

Code:
21:50:52,274 INFO  [DatabaseMetadata] table not found: FRAMEWK.RECORD_SEQ
21:50:52,461 INFO  [DatabaseMetadata] table not found: RECORD_SEQ
21:50:52,461 WARN  [ServiceController] Problem starting service persistence.units:ear=testEnroll.ear
,jar=testEnroll.jar,unitName=testEnroll
javax.persistence.PersistenceException: org.hibernate.HibernateException: Missing sequence or table:
FRAMEWK.RECORD_SEQ
        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:698)

        at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersi
stence.java:127)
        at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
...


This is how I've annotated the primary key in my entity:
Code:
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="RECORD_SEQ")
@SequenceGenerator(name="RECORD_SEQ", allocationSize=1, sequenceName="RECORD_SEQ")
public Long getRecord_Id() {
   return record_Id;
}


I know the sequence exists because I can execute the following and get a value back:
Code:
SELECT FRAMEWK.RECORD_SEQ.NEXTVAL FROM DUAL;


Is the problem because Hibernate is looking for a table instead of a sequence? Notice this line in the error:
Code:
21:50:52,461 INFO  [DatabaseMetadata] table not found: RECORD_SEQ


Does anyone know what the problem is? Or, please excuse me if I've missed something obvious.

Thanks!


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

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.