I changed the listener interfaces for the listeners involved. E.g.:
publicinterface PostInsertEventListener extends Serializable {
...
/**
* Does this listener require that after transaction hooks be registered? Typically this is {@code true}
* for post-insert event listeners, but may not be, for example, in JPA cases where there are no callbacks defined
* for the particular entity.
*
* @param persister The persister for the entity in question.
*
* @return {@code true} if after transaction callbacks should be added.
*/
publicboolean requiresPostCommitHanding(EntityPersister persister);
}
I adjusted the standard JPA and Envers implementations of these listeners to do the right thing. With custom listeners you will have to do the same. The idea though is that if any post-commit listeners for a given type of entity and type of callback return true the AfterTransactionCompletionProcess gets registered.
I changed the listener interfaces for the listeners involved. E.g.:
I adjusted the standard JPA and Envers implementations of these listeners to do the right thing. With custom listeners you will have to do the same. The idea though is that if any post-commit listeners for a given type of entity and type of callback return true the AfterTransactionCompletionProcess gets registered.