Hibernate version: 3.05
Mapping documents:
<generator class="org.hibernate.id.MultipleHiLoPerTableGenerator">
<param name="table">hmmtb_next_id</param>
<param name="primary_key_column">nxt_pk_col</param>
<param name="value_column">nxt_pk_value</param>
<param name="primary_key_value">item_id</param>
<param name="primary_key_length">30</param>
</generator>
Name and version of the database you are using: Sybase 12.5
When I insert a new record for any class mapped with the generator specified as above 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.
I found if I changed this line:
Code:
maxLo = PropertiesHelper.getInt(MAX_LO, params, Short.MAX_VALUE);
to:
Code:
maxLo = 0;
the generator works fine. Am I doing something stupid, or is this a bug in the generator for Sybase?