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

Grant Quimby (JIRA) jira-events at jboss.com
Wed Aug 16 18:36:38 EDT 2006


    [ http://jira.jboss.com/jira/browse/EJBTHREE-597?page=comments#action_12341363 ] 
            
Grant Quimby commented on EJBTHREE-597:
---------------------------------------

On 4.0.4.GA you can use the "allocationSize=1" parameter to workaround the issue. It does work quite well.

> 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
>
> @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