-->
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: Cache or Database
PostPosted: Tue Jan 10, 2006 2:18 pm 
Beginner
Beginner

Joined: Mon Oct 03, 2005 5:13 pm
Posts: 30
There is any way to know, while running an application in a random situation, if the hibernate gets data from cache or database?

Thanks for help :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 3:18 pm 
Beginner
Beginner

Joined: Mon Oct 03, 2005 5:13 pm
Posts: 30
I'd like to bring the Topic back to top. :-P

Anyone knows?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 5:27 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
If it's just for debugging purposes, then you can get a handle to your CacheManager using CacheManager.getInstance(), then loop through the caches in there, checking for your object.

If you want to run custom code based on whether or not an object is being loaded from the DB, then you probably want to put that code in an interceptor or a PostLoad event listener. Both of these options are explained in the reference docs, the chapter titled "Interceptors and events".


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.