-->
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: Interceptor preFlush
PostPosted: Tue Oct 21, 2003 12:33 pm 
Beginner
Beginner

Joined: Wed Sep 17, 2003 10:25 am
Posts: 36
Hi all,

I have been experimenting with the Interceptor interface trying to get some work done on my persistence entities after an update/save. I am mainly using postFlush to get the state of my entities and record that state somewhere else in my application (a requirement). Now, when I try to get the state of my entity in postFlush, I get a LazyInitialization exception (thought I had done enough work with Hibernate not to see this issue come up again :)). So, seems like in postFlush, the session is gone and I cannot do much with any attributes in my entity that were not initialized.

How can I get around this issue? What I want is for a mechanism to get all my entity's state after it has been persisted to the database (postFlush) and not have to deal with Lazy initialization issues. This needs to work for both creates and updates. Any ideas on how to enable this would be greatly appreciated. If you want me to post my mapping files/code that would be no problem but I am looking for some pointers from those who have use Interceptor and are familiar with when a session is still available to do work on the entity and when it is not. Can I do a copy of what is there in preFlush? The APi does not have enough documentation, although it could be very useful in verious situations!!! Might do this myself after I am over this hump!!!

thanks...


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.