-->
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.  [ 2 posts ] 
Author Message
 Post subject: In memory entity state after a DML Update
PostPosted: Fri Jan 29, 2010 2:19 pm 
Newbie

Joined: Fri Dec 05, 2008 3:36 pm
Posts: 3
I am performing a DML Update statement to affect multiple rows in the database. Directly after the update statement but before the transaction has been committed I eagerly fetch the data via a select statement. I set the session cache mode to IGNORE so that the select statement bypasses the second-level cache. The entity in question does not reflect the updated values. Does anyone know why I cannot refresh the in-memory entity state? I can see that the values have been updated in the db.


Top
 Profile  
 
 Post subject: Re: In memory entity state after a DML Update
PostPosted: Mon Feb 01, 2010 3:58 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
Is the entity cached in the first-level/session cache? If so you may have to call session.clear() or session.evict() before the select statement.


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

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.