pisymbol wrote:
I posted this in the JBoss forum's but came upon this more active Forum with respect to JUST hibernate.
And as such I forgot to mention the problem (dah):
The problem is that we have come across situations where Hibernate reuses a primary key that has been previous deleted (Entity was removed) which recycles the key generator causing exceptions.
So we have one Entity table that had 1,2,3 etc. till 43 and then 4 was deleted. Then we saw that a new Entity caused 4 to be reused so the next Entity is now 5 causing an EntityExists exception and the transaction fails. That's pretty much the pattern we see (this with the Hibernate shipped in JBoss404GA which I believe 3rc2 something or other - it flies by during deployment).
I decided to debug Hibernate itself and figure out exactly how it was determining what the next key is...etc...and stumbled across the above which I believe is the root of my problem.
Thanks again!