]
subes commented on HHH-5648:
----------------------------
I am also interested in this being fixed, because it limits me from using the
transactionReplay feature of BoneCP.
Auto-increment IDs should be assigned upon commit (or hooks made
available)
---------------------------------------------------------------------------
Key: HHH-5648
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5648
Project: Hibernate Core
Issue Type: Bug
Components: core
Environment: v3.6, mysql
Reporter: Wallace Wadge
The connection pool BoneCP (
http://jolbox.com) has support to automatically replay a
transaction when a database/network goes down. Under hibernate, since objects get their
IDs populated upon INSERTs, the following sequence of events is possible:
BEGIN TRANSACTION
INSERT STATEMENT
(object gets the ID field populated)
=> network goes down, new connection is given and transaction is replayed beneath
hibernate
COMMIT TRANSACTION
Now the database has given us a new ID but hibernate never had a chance to update the
object properly.
To fix: either assign the IDs upon a successful transaction commit or at least provide
some kind of hooking mechanism so as to correct the problematic objects.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: