-->
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.  [ 1 post ] 
Author Message
 Post subject: findDirty equivalent & onDirtyCheck not called
PostPosted: Tue Apr 15, 2008 10:03 am 
Newbie

Joined: Wed Nov 21, 2007 1:42 pm
Posts: 2
Hibernate version: 3.2.5 ga

Hi everyone,

Is there a simmilar event listener method to org.hibernate.Interceptor.findDirty()?

I need to catch all the instances that changed in persistence ctx before it gets flushed to DB.

Need to catch pojo that was changed with something like:

Code:
pojo.setProperty("a");
dao.save(pojo);


I tried to register DirtyCheckEventListener on dirty-check but that will be not called for some reason.

When I save the pojo it does onFlush, onSaveOrUpdate, onFlushEntity.

When I change it, it dirty checks collections from AbstractFlushingEventListener right after onSaveOrUpdate but that's it basically.

I was checking hibernate docs, Java Persistence with Hibernate... no luck.

One more question: I tried to find a state diagram with all the events that are called by core listeners with no luck, has anyone found something like that?

Thanks, Cheers


My spring(2.5.2) app ctx looks currently like this:

Code:
   <bean id="xxx.sessionFactory"
      class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
      <property name="dataSource" ref="xxx.DataSource" />
      <property name="mappingResources">
         <list>
            <value>a.pojo.hbm.xml</value>
         </list>
      </property>
      <property name="hibernateProperties"
         ref="xxx.HibernateProperties" />
      <property name="eventListeners" ref="xxx.eventListeners" />
   </bean>

   <!-- listeners -->

   <util:map id="xxx.eventListeners">
      <entry key="flush-entity">
         <list>
            <ref local="DefaultFlushEntityEventListener" />
            <ref local="xxx.myListener" />
         </list>
      </entry>
      <entry key="flush">
         <list>
            <ref local="DefaultFlushEventListener" />
            <ref local="xxx.myListener" />
         </list>
      </entry>
      <entry key="save-update">
         <list>
            <ref local="DefaultSaveOrUpdateEventListener" />
            <ref local="xxx.myListener" />
         </list>
      </entry>
      <entry key="dirty-check">
         <list>
            <ref local="DefaultDirtyCheckEventListener" />
            <ref local="xxx.myListener" />
         </list>
      </entry>
      <entry key="delete">
         <list>
            <ref local="DefaultDeleteEventListener" />
            <ref local="xxx.myListener" />
         </list>
      </entry>
   </util:map>


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

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.