Details
-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
EJB 3.0 RC7 - FD
-
None
-
None
Description
@javax.persistence.SequenceGenerator(name = "Question_id_sequence", sequenceName = "S_QUESTION")
is mapped to a "seqhilo" generator by org.hibernate.cfg.AnnotationBinder (line 332) which causes strange ids to be generated. These ids appear to have no relation to the actual sequence state, even though "select S_QUESTION.nextVal from dual" is generated by Hibernate through JDBC. The ids start at 50 for an intial deployment, 150 after a redeployment, then 250 for the following deployment, etc, etc.
If stored procedures are used which use the S_QUESTION sequence to insert rows into the same table then a conflict will happen sometime in the future, since Hibernate does not use the value from the sequence.
If I replace the above @javax.persistence.SequenceGenerator definition with:
@org.hibernate.annotations.GenericGenerator(name="Question_id_sequence", strategy = "sequence",
parameters =
)
the actual S_QUESTION.nextVal value is used correctly by Hibernate.