-->
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: "evict" safety
PostPosted: Tue Jan 11, 2005 8:59 pm 
Newbie

Joined: Thu Mar 25, 2004 2:32 pm
Posts: 6
Hi all,

I am thinking about using hibernate's second level cache with database change notification. Basically if some legacy application updates the database from underneath me, I want to either through a database trigger or through polling get notified about the change, then evict the affected objects from the second level cache. Essentially what this article talks about:

http://www.theserverside.com/articles/a ... rs-Writers

So I am wondering if hibernate's "evict" operations are safe enough without using the locks? Can my background thread do the evictions while the business tier still access the cache at the same time?

Thanks,

Rong


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 7:23 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
From the API
Quote:
Evict an entry from the second-level cache. This method occurs outside of any transaction; it performs an immediate "hard" remove, so does not respect any transaction isolation semantics of the usage strategy. Use with care.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 11:13 am 
Newbie

Joined: Thu Mar 25, 2004 2:32 pm
Posts: 6
Yes, I've read the javadoc. It's just not completely clear to me what it means. My guess is to be safe I'd have to do the reader/writer lock for background eviction.


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.