-->
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: Caching and IdentityMap
PostPosted: Fri May 07, 2004 7:26 pm 
Regular
Regular

Joined: Thu Apr 29, 2004 5:08 pm
Posts: 56
Location: Montreal, Quebec, Canada
Hi,

We are developing a rich client (swing) on a client-server architecture (2-tier), and I decided, with Emmanuel's approval (http://forum.hibernate.org/viewtopic.php?t=930418), to use a single session for the whole application lifecycle.

I know I have to be careful at managing the session (calling evict
() for instance). I'll use optimistic locking to address concurrency (when saving).

The main reason I want to use a single session is for the == JVM equality, on domain objects, guaranteed through its whole life. I guess this is handled by the Identity Map design pattern.

May I use the identity map without caching objects? In other words, each time something is queried through Hibernate's session, I would like it to actually query the database without checking the cache but checking its identity map.

This would ensure that each time I query objects from Hibernate, I receive fresh copies of unknown objects, and the one in the identity map would be simply updated. Then I would update all views (observers) attached to these objects (MVC design pattern for the presentation layer).

Can I ask hibernate to do the same when fetching objects through a domain object relation? (ie. animal.getRegions() ).

If there's a way to turn off caching still ensuring object == JVM equality with the identity map, that would be perfect.

Thanks

_________________
- Frank


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 08, 2004 7:05 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Session-Level caching is necessary for object identity and can not be turned of.


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.