[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Oracle sequences not being found
steve_of_AR
do-not-reply at jboss.com
Mon May 14 12:31:07 EDT 2007
I'm getting validation exceptions from Hibernate during deployment of my (seam-gen generated) app, saying it can't find my sequences in Oracle, but the sequences are there. From the log I can see it's trying qualified and unqualified names, either should be fine.
Entity
| @Id
| @SequenceGenerator(name = "analysesGenerator", sequenceName = "SEQUENCE_ANALYSES")
| @GeneratedValue(strategy = SEQUENCE, generator = "analysesGenerator")
| @Column(name = "ANALYSIS_ID", unique = true, nullable = false, precision = 22, scale = 0)
| @NotNull
| public BigDecimal getAnalysisId() {
| return this.analysisId;
| }
Exception during deployment:
Deployment log
| 09:53:32,006 INFO [DatabaseMetadata] table not found: JANUS.SEQUENCE_ANALYSES
| 09:53:32,009 INFO [DatabaseMetadata] table not found: SEQUENCE_ANALYSES
| 09:53:32,015 WARN [ServiceController] Problem starting service persistence.units:ear=Janus.ear,unitName=Janus
| javax.persistence.PersistenceException: org.hibernate.HibernateException: Missing sequence or table: JANUS.SEQUENCE_ANALYSES
| at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:698)
|
|
However the sequences are certainly there:
| > SELECT JANUS.SEQUENCE_ANALYSES.nextval FROM Dual
|
| NEXTVAL
| ----------------------
| 2
|
|
I can turn off hibernate validation, but then I get validation exceptions when I try to save a record from a form. If I turn off sequence generation altogether (making the user enter the pk values manually), the records save just fine - but obviously users won't tolerate this.
PS: Here's another user that seems to have the identical problem, on the hibernate forums recently:
http://forum.hibernate.org/viewtopic.php?t=971878&highlight=hibernateexception+sequence
Anybody have any ideas?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4045549#4045549
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4045549
More information about the jboss-user
mailing list