3

I've got the following JPA entity:

@Entity
@Table(schema = "myschema")
@SequenceGenerator(schema = "myschema", name = "seqGenerator", 
                   sequenceName  = "person_s1", allocationSize = 1)
public class Person {

@Id
@GeneratedValue(generator = "seqGenerator", strategy = GenerationType.AUTO)
private long id;

the following exceptions are thrown:

Call: DROP SEQUENCE myschema.person_s1
Query: DataModifyQuery(sql="DROP SEQUENCE myschema.person_s1")
[EL Warning]: 2010-11-01 17:21:51.051--ServerSession(10605044)--Exception [EclipseLink-    4002] (Eclipse Persistence Services - 2.1.1.v20100817-r8050): 
org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: ORA-02289: sequence does not exist

Error Code: 2289
Call: SELECT myschema.person_s1.NEXTVAL FROM DUAL
Query: ValueReadQuery(sql="SELECT myschema.person_s1.NEXTVAL FROM DUAL")

The sequence is genrated by EclipseLink and the query:

SELECT myschema.person_s1.NEXTVAL FROM DUAL

works fine when used directly...

Any help appreciated

Regards Marcel

2 Answers 2

3

the following exceptions are thrown (...)

These traces are generated during schema creation when a particular database object doesn't exist and thus can't be dropped. EclipseLink report such cases as Warning (which are not Error), they can be ignored (you get your sequence, right?).

PS: Why do you use an allocation size of 1, don't you want to benefit from the high/low optimization?

Sign up to request clarification or add additional context in comments.

2 Comments

Merci beaucoup Pascal. What is high/ low optimization? Might you drop me a line on that? Marcel
FWIW I've logged it as a bug in EclipseLink: bugs.eclipse.org/bugs/show_bug.cgi?id=487795. Motivation for calling it a bug is in the bug report.
0

I know this is going to sound really silly, but here it is anyway.

@Entity
@Table(schema = "myschema")
public class Person {

   @Id
   @SequenceGenerator(schema = "myschema", name = "seqGenerator", sequenceName  = "person_s1", allocationSize = 1)
   @GeneratedValue(generator = "seqGenerator", strategy = GenerationType.AUTO)
   private Long id;
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.