-->
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.  [ 3 posts ] 
Author Message
 Post subject: Second-Level Cache
PostPosted: Sun Jun 20, 2004 6:17 am 
Beginner
Beginner

Joined: Fri Jan 23, 2004 4:29 pm
Posts: 39
I'm using
Hibernate 2.1.2
Spring 1.0.1
OsCache 2.0.2


In my use case I'm using both JDBC and Hibernate to update data.
I'm using the second-level cache to cache the data. And when I update
the data I also want the second-level cache to be updated.

The problem is that when I use JDBC to update the data the second-level cache is of course not updated.

How can I avoid this?

I understand that I can use SessionFactory.evict but is there something better. For example can I tell Hibernate to execute the update query. And will the second-level cache be updated in that case?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 20, 2004 12:21 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
when an object is updated even in hibernate, most of the time it is evicted from the second level cache (not updated).

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 20, 2004 3:27 pm 
Beginner
Beginner

Joined: Fri Jan 23, 2004 4:29 pm
Posts: 39
Ok. I will just have to evict the objects after running the SQL update with JDBC.


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