Hi,
I'm pretty sure the reason is because H2 caches the next 32 identity
values, so if you close the database and open it again, then it will
skip those values. There isn't a guarantee that it always increment by
1. Pretty sure if you roll back transactions then it skips the value
also. I'm sure it's come up on the forums a few times.
If it isn't between closing and opening the database, I'm not sure! :)
Thanks, Ryan
On 2/10/2012 3:11 PM, Jashveer Anand wrote:
Hi all,
H2 is very fast and fantastic to work.
I recently upgraded H2 1.3.168. And converted all my auto_increment
columns to Identity().
I have tables with identity column and I am using scope_identity() to
get the value, since I am using triggers.
Some occasions, the identity column generating is incrementing by 32
and randomly sometimes.
Can anyone help me solve this issue. ?
Advance thanks and regards,
Anand Jashveer
--
You received this message because you are subscribed to the Google
Groups "H2 Database" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/h2-database/-/EcusiDoq3y0J.
To post to this group, send email to h2-database@googlegroups.com.
To unsubscribe from this group, send email to
h2-database+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en.
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to h2-database@googlegroups.com.
To unsubscribe from this group, send email to
h2-database+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en.