[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3586) SequenceHiLoGenerator generates values ahead of the actual sequence

Krasimir Chobantonov (JIRA) noreply at atlassian.com
Fri Mar 26 06:06:32 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=35968#action_35968 ] 

Krasimir Chobantonov commented on HHH-3586:
-------------------------------------------

I do not see why we can't change the multiplication to addition - also the long type is not limitless.. 

when you add those three variables : number of machines in the cluster, number of rollbacks, number of entities  - you can see that with this approach we will go much sooner to the end limit of long than if we are using the addition (+)

also the problem here is that if you have external system that is adding/inserting rows using the same sequence then the whole thing might not work - e.g. no one will expect that when you have step 50 for example that some program/software will insert rows with greater id that the current sequence.... - so from this point at least this seems as a bug to me. ( do not try to look only from the perspective that the Hibernate is the only tool that is beeing used when accessing the database - there are triggers, ETL process and etc.. as well)

Krasimir

> SequenceHiLoGenerator generates values ahead of the actual sequence
> -------------------------------------------------------------------
>
>                 Key: HHH-3586
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3586
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.3.1
>         Environment: Hibernate 3.3.1, Oracle 10G
>            Reporter: Krasimir Chobantonov
>   Original Estimate: 1 hour
>  Remaining Estimate: 1 hour
>
> The code that needs to be change in on line 83 of the SequenceHiLoGenerator
> here is the line
> 			hi = hival * ( maxLo+1 );
> basically we should add (+) the maxLo +1 to the current sequence value represented bu the hival instead of using multiply (*)

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

        


More information about the hibernate-issues mailing list