-->
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.  [ 4 posts ] 
Author Message
 Post subject: Disable Session-level cache?
PostPosted: Sun Sep 14, 2003 2:20 pm 
Newbie

Joined: Sun Sep 14, 2003 11:51 am
Posts: 3
Location: Atlanta, GA
Is it possible to disable the Session-level cache, and just rely on the SessionFactory-level cache (JCS)?

I am trying to setup Hibernate in a configuration where multiple Sessions can read from the same cache. This is obviously not possible with the Session-level cache, since it is not shared between Sessions. However it is possible with the JCS cache, since it is used by the SessionFactory.

I can accomplish this by simply creating a new Session every time I access Hibernate objects, thusly never allowing a given Session to respond to my queries with Session-level cache data. But I am hoping to avoid doing this by simply disabling the Session-level cache. I imagine there is also a good bit of overhead involved in creating so many Sessions.

There doesn't appear to be a method on the Session interface to disable its cache. If there were a method Session.evict(Class), I could probably get by, but there is only Session.evict(Object).

Any thoughts, or perhaps alternate approaches?

Thanks,
Keith


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 14, 2003 11:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
There is Session.clear() ?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 15, 2003 10:46 am 
Newbie

Joined: Sun Sep 14, 2003 11:51 am
Posts: 3
Location: Atlanta, GA
I don't see a Session.clear() in the API docs on the website. Is this in a newer version of hibernate perhaps? I'm using 2.0.3.

Thanks,
Keith


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 15, 2003 1:05 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
yeah, its 2.1


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