Hi
I have an object for which i am using the sequence generator.. as follows
Code:
<id name="key" type="long">
<column name="ASSOCIATE_SEQNUM" sql-type="number" />
<generator class="org.hibernate.id.enhanced.SequenceStyleGenerator">
<param name="optimizer">pooled</param>
<param name="increment_size">10</param>
<param name="sequence_name">SQ_ASSOCIATE_XREF</param>
</generator>
</id>
The increment size is set to be 10. When I send a request to insert 100 instances of this object, the sequence number (key) for these object is in negative numbers. There are 10 records with positive numbers (11 to 20) and the rest have negative numbers.
I have the same setup for sequences for several other objects, that are persisted NOT using spring and hibernate combination, and they get the sequence numbers correctly. Not sure if i am seeing this issue because of the spring and hibernate combination or not.
I am using hibernateTemplate.saveOrUpdate for persisting my objects. Its puzzling and dont know where to look for an answer.
on the other hand, when i check the currval or nextval on the oracle sequence, the number looks right. So hibernate seems to be making the call to oracle to get the next set of sequence numbers.
What am i doing wrong.
TIA.
Srikanth