-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Some listener are not called
PostPosted: Mon Oct 24, 2005 8:34 am 
Newbie

Joined: Mon Oct 24, 2005 8:18 am
Posts: 6
I'm trying to register several hibernate listeners under JBoss 4.0.3 using EJB 3.

In my hibernate.cfg.xml I've defined:

Code:
<hibernate-configuration>
        <session-factory>
                <listener type="flush-entity" class="sirma.biz.TheFlushEntityListener"/>
                <listener type="load" class="sirma.biz.TheLoadListener"/>
                <listener type="save" class="sirma.biz.TheSaveListener"/>
                <listener type="delete" class="sirma.biz.TheDeleteListener"/>
                <listener type="dirty-check" class="sirma.biz.TheDirtyCheckListener"/>
                ...

where

Code:
          public class TheFlushEntityListener extends DefaultFlushEntityEventListener
          public class TheLoadListener extends DefaultLoadEventListener
          ...

JBoss instantiates all the configured listener classes at deploy-time. But it only calls the methods of the "load" listener. (The way I test this is via overriding all protected and public methods of the super classes and logging something before calling super.theMethod(...), but none of them is called, except for TheLoadListener.)

What might be the reason?


Top
 Profile  
 
 Post subject: Hibernate listeners
PostPosted: Wed Oct 26, 2005 3:40 am 
Newbie

Joined: Wed Oct 26, 2005 3:37 am
Posts: 15
It seems currently listeners cannot be overridden in the JBoss EJB3 preview.
I wonder if it is planned for future implementation?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 26, 2005 5:29 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Yes this is planned. We've made the listener event system more flexible in H 3.1 to allow several listeners per event.
Note that EJB3 listeners implementation are not always the same as Hibernate core listener

_________________
Emmanuel


Top
 Profile  
 
 Post subject: listeners
PostPosted: Wed Oct 26, 2005 5:51 am 
Newbie

Joined: Wed Oct 26, 2005 3:37 am
Posts: 15
Thank you for the reply.
I had a look at the org.hibernate.ejb.EventListenerConfigurator and how the extended ejb listeners are set.
Can you possibly say when event listeners could be used with ejb3 (I mean, the jboss implementation)?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.