[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5648) Auto-increment IDs should be assigned upon commit (or hooks made available)

subes (JIRA) noreply at atlassian.com
Mon Feb 7 11:18:05 EST 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=39855#action_39855 ] 

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: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list