-->
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.  [ 6 posts ] 
Author Message
 Post subject: Turning Cache Off
PostPosted: Fri Nov 04, 2005 12:48 pm 
Newbie

Joined: Fri Nov 04, 2005 12:32 pm
Posts: 14
Location: Detroit, MI, USA
Hibernate version: 3.0.5

Mapping documents:

Code between sessionFactory.openSession() and session.close():
Code:
//Initial load of data
.load

//Data changes in the database

.load  //Changes not reflected in object because of the cache


Full stack trace of any exception that occurs: N/A

Name and version of the database you are using: Oracle 9

The generated SQL (show_sql=true): N/A

Debug level Hibernate log excerpt: N/A


Is there anyway to turn off the first level cache? I was using .clear(), but now with leveraging lazy loading, I receive an "evicted collection" exception after the clear. Any ideas or suggestions?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 04, 2005 5:11 pm 
Beginner
Beginner

Joined: Tue Aug 23, 2005 3:52 pm
Posts: 26
close the session


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 04, 2005 5:21 pm 
Newbie

Joined: Fri Nov 04, 2005 12:32 pm
Posts: 14
Location: Detroit, MI, USA
If you close the session, then you cannot use the lazy loading.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 2:58 pm 
Newbie

Joined: Fri Nov 04, 2005 12:32 pm
Posts: 14
Location: Detroit, MI, USA
From Hibernate in Action...."The first-level cache is mandatory and can’t be turned off"

As anyone come across this caching problem? I can't have any cache on because the data is constantly modified outside of Hibernate.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 3:11 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
the case you describe happens in a full transactional with the correct isolation) system even wo Hibernate.

to refresh an object use .refresh()

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 3:17 pm 
Newbie

Joined: Fri Nov 04, 2005 12:32 pm
Posts: 14
Location: Detroit, MI, USA
Yes I have seen that and it looks like the only solution.

Thank you very much for your help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.