I have the following line in my persistence.xml:

  |     <property name="hibernate.ejb.cfgfile" value="hibernate_config.xml"/>
  | 

In hibernate_config.xml, I have:


  | <?xml version='1.0' encoding='utf-8'?>
  | <!DOCTYPE hibernate-configuration PUBLIC
  |    "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
  |    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd";>
  |     <hibernate-configuration>
  |             <session-factory>
  |                     <event type="save-update">
  |                             <listener 
class="com.fcl.util.HibernateEventListener"/>
  |                     </event>
  |                     <event type="pre-update">
  |                             <listener 
class="com.fcl.util.HibernateEventListener"/>
  |                     </event>
  |                     <event type="post-commit-update">
  |                             <listener 
class="com.fcl.util.HibernateEventListener"/>
  |                     <listener 
class="org.hibernate.lucene.event.LuceneEventListener"/>
  |                     </event>
  |                     <event type="post-commit-insert">
  |                             <listener 
class="com.fcl.util.HibernateEventListener"/>
  |                     <listener 
class="org.hibernate.lucene.event.LuceneEventListener"/>
  |                     </event>
  |                     <event type="post-commit-delete">
  |                             <listener 
class="com.fcl.util.HibernateEventListener"/>
  |                     <listener 
class="org.hibernate.lucene.event.LuceneEventListener"/>
  |                     </event>
  |             </session-factory>
  |     </hibernate-configuration>

So, I want to have my own listener on the pre-update event.

The way JBoss configures its hibernate session factory overwrites setting from 
hibernate_config.xml

It processes hibernate_config.xml first, and sets the listeners, but then JBoss 
has to do its own configuration for its own purposes.

The way hibernate event listeners are set is that you pass an array of listener 
objects to associate with a certain event.

This array becomes the new listener set. They are not added - all previous 
listeners are lost.

So JBoss is overwriting some configuration settings.

IMHO, this is a bug. I cannot configure Hibernate as I require.

In the absence of an addBlahEventListener() call in hibernate, surely JBoss, 
should tread more carefully by getting the listener array, copying it into a 
new array, adding its own to the end (or the beginning - whatever), and then 
setting the listeners.

How do I go about reporting this?

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3919312#3919312

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3919312


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to