-->
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: understanding the cache and a long-running application
PostPosted: Thu Nov 23, 2006 5:28 am 
Beginner
Beginner

Joined: Thu Aug 24, 2006 6:01 am
Posts: 49
Location: sophia-antipolis, France
Hibernate version: 3.2

Hi,

I have an application which loads all objects of a graph in memory at startup and then can run indefinitely always using the in-memory objects. When the application receives messages from other applications, it starts a transaction and performs graph traversals and calculations. At the end, it has a list of changed objects and does an update for these objects and then the transaction ends.

What I don't really understand is the session scope. I imagine that my session is limited to my transaction, therefore the session cache is created and destroyed each time my method starts and finishes. Therefore, the session cache doesn't really do me any good and my objects are detached almost all of the time. This is ok with me, but it's important to understand so that I don't think about using the automatic dirty detection.

Even the second-level cache is limited to the scope of the transaction, so I can't really use the caches at all it seems.

Can anyone confirm or refute this for me?

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 23, 2006 8:35 am 
Beginner
Beginner

Joined: Thu Aug 24, 2006 6:01 am
Posts: 49
Location: sophia-antipolis, France
ok, i've looked further at 2nd-level caches and it looks like what I want. I just have to enable the 2nd-level cache and attach all of my objects that I have loaded from my SQL query.

but does the 2nd-level cache enter into the automatic dirty detection and write-behind?


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.