[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-1148) MultipleHiLoPerTableGenerator generates incorrect primary key

Steve Ebersole (JIRA) noreply at atlassian.com
Mon Mar 21 13:01:08 EDT 2011


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Ebersole closed HHH-1148.
-------------------------------


Closing stale resolved issues

> MultipleHiLoPerTableGenerator generates incorrect primary key
> -------------------------------------------------------------
>
>                 Key: HHH-1148
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1148
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.0.5
>         Environment: Hibernate 3.05, Sybase 12.5.1, Tomcat 5.0.28 + Websphere 6.02
>            Reporter: Jim H
>            Priority: Minor
>
> When I insert a new record for any class mapped using the MultipleHiLoPerTableGenerator I am getting incorrect primary key values assigned. The key for each record is (32768 x correct value). So if the correct value should be 1 the assigned pk is 32768. The next record's pk becomes 65536, then 98304, etc. The hi value updated in the next id table is correct.  The primary key is of type int.
> I was able to alter MultipleHiLoPerTableGenerator.java to return the correct values by replacing the line 
> maxLo = PropertiesHelper.getInt(MAX_LO, params, Short.MAX_VALUE);
> with
> maxLo = 0;
> There is a posting on the forum (http://forum.hibernate.org/viewtopic.php?t=949810) that has more info.

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