-->
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: Fetch data exclusivly from database - not session
PostPosted: Tue Jun 29, 2010 3:52 am 
Newbie

Joined: Wed Apr 28, 2010 2:41 am
Posts: 3
Hi All,

I am developing a fucntionality where in I need to get the fields which have changed in the current transaction. I use the following steps:

1. On @PreUpdate, I fetch the previous state of the object from the database (using findById()).
2. Compare the fetched object with the one I already have from the transaction
3. Print the columns which are different.

But the object fetched in step 1 is same as the one I have in my session. So all the fields are the same always. I woulkd like to know if there is a way to exclusivly fetch data from the database again irrespective of the session data.

Also, is there are better way to find the fields which have changed in the current transaction ?

Thanks for the help,
Midhun


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.