[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6945) EventListeners not called with Hibernate 4.0
Steve Ebersole (JIRA)
noreply at atlassian.com
Fri Jan 6 18:07:09 EST 2012
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44996#comment-44996 ]
Steve Ebersole commented on HHH-6945:
-------------------------------------
The new approach is to use an {{org.hibernate.integrator.spi.Integrator}} to register the event listeners. There are a few example of this in Hibernate itself. The 2 most straight forward examples are
* org.hibernate.ejb.event.JpaIntegrator -> https://github.com/hibernate/hibernate-core/blob/master/hibernate-entitymanager/src/main/java/org/hibernate/ejb/event/JpaIntegrator.java
* org.hibernate.envers.event.EnversIntegrator -> https://github.com/hibernate/hibernate-core/blob/master/hibernate-envers/src/main/java/org/hibernate/envers/event/EnversIntegrator.java
> EventListeners not called with Hibernate 4.0
> --------------------------------------------
>
> Key: HHH-6945
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6945
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 4.0.0.Final
> Environment: windows 7
> Reporter: Jakob Braeuchi
> Priority: Critical
> Attachments: test.events.zip
>
>
> i tried to upgrade hibernate from version 3.6.9 to 4.0.0 .
> in my config i have some EventListeners used for auditing. after adapting my Listeners to the new api (event.FlushEventListener -> event.spi.FlushEventListener) i found that none of my listeners is called.
> the attached zip contains a small testcase with Flush-, PreInsert- and PostInsertEventListeners.
> this testcase works with hibernate 3.6 and i can see the output of the listeners in the console.
> hibernate 3.6 logs the EventListeners to the console:
> 23:08:07,827 DEBUG Configuration:2406 - Event listeners: flush=test.events.MyFlushEventListener, org.hibernate.event.def.DefaultFlushEventListener
> 23:08:07,837 DEBUG Configuration:2406 - Event listeners: pre-insert=test.events.MyPreInsertEventListener
> 23:08:07,840 DEBUG Configuration:2406 - Event listeners: post-insert=test.events.MyPostInsertEventListener
> there's no such output from hibernate 4.0
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list