-->
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: Second level cache question
PostPosted: Tue May 04, 2004 1:42 pm 
Newbie

Joined: Fri Oct 03, 2003 6:47 am
Posts: 15
Hi,
I'm trying to get second level cache to work using the EHCache provider. First, I get following in my log when starting:

Code:
DEBUG [main] (Configuration.java:1104) - instantiating cache se.tnsys.monster.model.monitor.MonitorView
WARN [main] (Configurator.java:123) - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: file:/C:/jakarta/jakarta-tomcat-5.0.19/work/Catalina/localhost/monster/loader/ehcache-failsafe.xml


Then I get following for each of my mapped classes during "Hibernate Configuration startup"

Code:
WARN [main] (Plugin.java:95) - Could not find configuration for se.tnsys.monster.model.monitor.MonitorView. Configuring using the defaultCache settings.
DEBUG [main] (Configuration.java:1104) - instantiating cache se.tnsys.monster.model.schedule.MonsterMonitorSchedule


Once Tomcat is started everything works but I suspect the cache isn't working as "show_sql" indicates lots of sql that aren't needed.

I have mapped my classes with cache usage=read-write (XDoclet) but not mapped any "Collection mappings".

Is there any simple way to check that objects are fetched from the cache rather than through sql??

I'm using Hbm 2.1.3 together with MySQL 4.0.12.

Thanks // Torben


Top
 Profile  
 
 Post subject: Cache logging
PostPosted: Tue May 04, 2004 1:54 pm 
Newbie

Joined: Fri Oct 03, 2003 6:47 am
Posts: 15
Hi,
I found out that my caching worked!

One primitive way of keeping an eye on if the caching really works is to enable DEBUG level logging on the ReadWriteCache class. If your using log4j:

log4j.logger.net.sf.hibernate.cache.ReadWriteCache=DEBUG

Then you will get a bunch of usefull information if your objects are fetched from the cache or not....

// Torben


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.