-->
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: Cache
PostPosted: Wed Nov 30, 2005 2:53 pm 
Newbie

Joined: Wed Nov 30, 2005 2:23 pm
Posts: 4
Hello Experts

I was wondering if there is any way to store an object in Hibernate cache. In other words How can I store the transient object ? I don't want this object to be persisted when the session is flushed .
One way to do that would be execute evict to remove the object from the cache before doing flush.
But is there any other way to do this automatically ?

Thanks
Sunil[/b]


Top
 Profile  
 
 Post subject: EhCache
PostPosted: Wed Nov 30, 2005 4:09 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Assuming you're using the default EhCache, you can get a handle to the using CacheManager.getInstance(). This won't let you look up objects using hibernate gets or queries, but it should do if you just want a runtime cache.

Check out http://ehcache.sourceforge.net/ for more info.


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.