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

Steve McIntyre (JIRA) jira-events at lists.jboss.org
Wed Mar 5 12:09:58 EST 2008


    [ http://jira.jboss.com/jira/browse/EJBTHREE-597?page=comments#action_12401457 ] 
            
Steve McIntyre commented on EJBTHREE-597:
-----------------------------------------

Is there a way to get hibernate to map sequence generators to a pooled sequence strategy?

Specifically, we need hibernate to honor and use the sequence. However, we'd also like hibernate to grab N sequence values at a time and use them. We don't want hibernate to use an allocationSize multiplier to "calculate" a value, that isn't directly tied to the sequence. 

> 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