[jboss-jira] [JBoss JIRA] Resolved: (EJBTHREE-597) javax.persistence.SequenceGenerator mapped to "seqhilo" and not "sequence" by org.hibernate.cfg.AnnotationBinder

Emmanuel Bernard (JIRA) jira-events at lists.jboss.org
Tue Feb 13 22:13:35 EST 2007


     [ http://jira.jboss.com/jira/browse/EJBTHREE-597?page=all ]

Emmanuel Bernard resolved EJBTHREE-597.
---------------------------------------

    Resolution: Rejected
      Assignee: Emmanuel Bernard

this is as per the spec, use allocationSze=1

> javax.persistence.SequenceGenerator mapped to "seqhilo" and not "sequence" by org.hibernate.cfg.AnnotationBinder
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: EJBTHREE-597
>                 URL: http://jira.jboss.com/jira/browse/EJBTHREE-597
>             Project: EJB 3.0
>          Issue Type: Bug
>    Affects Versions: EJB 3.0 RC7 - FD
>         Environment: JBoss 4.0.4.GA (using EJB3 packaged in that version of JBoss), Windows XP SP1, Java 1.5.04, Oracle 9
>            Reporter: David Richmond
>         Assigned To: Emmanuel Bernard
>
> @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 = {  @Parameter(name="sequence", value="S_QUESTION")   }  )
> the actual S_QUESTION.nextVal  value is used correctly by Hibernate.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list