-->
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: How to make the difference between
PostPosted: Sat Oct 29, 2005 12:31 pm 
Newbie

Joined: Fri Aug 12, 2005 5:41 am
Posts: 5
Hi,

I am using an Interceptor to trigger some events when a persistent object is saved, deleted, or updated.

The behaviour I am trying to implement is :

- call onSave() when a new object is saved.
- call onDelete() when an object is deleted.
- call onFlushDirty() when an object is updated.

I am using the OpenSessionInViewFilter from spring so the session is flushed automatically.

My problem is that when I delete an object, the onDelete() method is called (expected behaviour) but when the session is flushed onFlushDirty() is called for the deleted object again.

Is there a way to prevent onFlushDirty() to be called for deleted objects?

I also tried to make the difference between calls to onFlushDirty() for the updated objects and those for the deleted objects (using previousState and currentState but didn't succeed)

Any hint are very welcome, thanks

Thomas

Hibernate version: 3.0.5


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.