[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1582) PostInsertListener + "post-commit-insert"

Holger Wagner (JIRA) noreply at atlassian.com
Thu Oct 22 09:08:28 EDT 2009


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

Holger Wagner commented on HHH-1582:
------------------------------------

Here is an stack-trace for this situation:

EntityInsertAction.postCommitInsert() line: 126	
EntityInsertAction.afterTransactionCompletion(boolean) line: 162	
ActionQueue.afterTransactionCompletion(boolean) line: 170	
SessionImpl.afterTransactionCompletion(boolean, Transaction) line: 419	
JDBCContext.afterTransactionCompletion(boolean, Transaction) line: 209	
JDBCTransaction.rollback() line: 174	
HibernateTransactionManager.doRollback(DefaultTransactionStatus) line: 603	
HibernateTransactionManager(AbstractPlatformTransactionManager).processRollback(DefaultTransactionStatus) line: 583	
HibernateTransactionManager(AbstractPlatformTransactionManager).rollback(TransactionStatus) line: 560	
AbschnittDao(RevisionDao<T>).runInTransaction(Runnable) line: 622	
AbschnittDao(RevisionDao<T>).update(T) line: 571	


> PostInsertListener + "post-commit-insert"
> -----------------------------------------
>
>                 Key: HHH-1582
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1582
>             Project: Hibernate Core
>          Issue Type: Bug
>    Affects Versions: 3.1.2
>            Reporter: Daniel Gredler
>            Assignee: Emmanuel Bernard
>   Original Estimate: 3 hours
>  Remaining Estimate: 3 hours
>
> I'm using a custom PostInsertEventListener mapped to the "post-commit-insert" event to process domain objects. However, PostInsertEventListener's onPostInsert(PostInsertEvent) is getting called even when the insert was not successful (ie, due to a unique constraint in the database or some such). It looks to me like Hibernate should either a) not invoke the event listener if the insert failed or b) provide state (perhaps in the form of a boolean indicating success/failure). Personally I'd rather the method not be called on failure, but there may be use cases out there for the second option.
> As an example, it looks like Hibernate's own LuceneEventListener will add a domain object to the index in onPostInsert(PostInsertEvent) even if the insert failed.
> Note that this problem also seems to exist in EntityDeleteAction and EntityUpdateAction (which would mean that Hibernate's LuceneEventListener removes domain objects from the Lucene index even if the delete fails!).

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