[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4784) JDBCTransaction -> commit() -> notifyLocalSynchsBeforeTransactionCompletion()

Hernán Chanfreau (JIRA) noreply at atlassian.com
Wed Mar 10 06:55:47 EST 2010


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

Hernán Chanfreau commented on HHH-4784:
---------------------------------------

I agree about letting the upper layer to take care of the transaction management. Besides, when notifyLocalSynchsBeforeTransactionCompletion() method returns without errors, hibernate executed the commit for the same transaction that AudotSync has rollbacked.

Here is a link to a discussion on envers forum: http://community.jboss.org/thread/149037?tstart=0

Can´t we discuss this there? Thanks! Hernán.





> JDBCTransaction -> commit() -> notifyLocalSynchsBeforeTransactionCompletion()
> -----------------------------------------------------------------------------
>
>                 Key: HHH-4784
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4784
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.5.0-Beta-2
>         Environment: hibernate-distribution-3.5.0-Beta-2
> ms-sqlserver 2008
>            Reporter: Silvan Eugen Lincan
>            Assignee: Adam Warski
>             Fix For: 3.5.0.Next
>
>
> Java class: org.hibernate.transaction.JDBCTransaction
> method: commit()
> line: 140 call to notifyLocalSynchsBeforeTransactionCompletion()
> The problem is this: method notifyLocalSynchsBeforeTransactionCompletion(), it swallows any exception that may occur at this level and permits the execution flow of commit() method to continue.
> But in this case, the hibernate session may be already corrupted, so the commit will be wrong.
> In my opinion, the method notifyLocalSynchsBeforeTransactionCompletion() should throw the exception, and on line 140 in commit() method, the call to this notifyLocalSynchsBeforeTransactionCompletion() should be surrounded also in the try{}catch(){}.
> Otherwise, any error that can occur on Synchronization, will be omitted and the transaction committed(it should be rolled back).
> I had this problem, executing the tests from envers module with the ms sqlserver 2008 database.
> The test org.hibernate.envers.test.integration.reventity.ExceptionListener crashes.
> I hope that it deserves your attention.
> Thank you very much.

-- 
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