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

Guenther Demetz (JIRA) noreply at atlassian.com
Fri Mar 26 04:37:33 EDT 2010


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

Guenther Demetz commented on HHH-3586:
--------------------------------------

Hi Krasimir,

also I'm pretty sure this is not a bug. 
Huge "holes" in the ids are not to consider a problem:
there exists definitely no paper which specifies that the id numbers must be contiguous.
Also the justification that the number range will exhaust to early because of the huge "holes" is not firm
(even in cluster environments).
Holes in the numbers are an accepted and well known sideffect of the Hi-Lo algorithm,
which is a compromise for maintaining performance (=avoid lock waits) also in high-concurrent scenarios 
(as a clustered environment even might be!)


> 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