-->
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: Hibernate Secound Level cache not being hit.
PostPosted: Tue Jul 25, 2006 3:36 pm 
Newbie

Joined: Fri Jun 02, 2006 2:49 pm
Posts: 13
Hello everyone.
I have a bit of a problem with the secound level cache. A bit lost here and not sure if it's Hibernate or Jboss. I have configured everything per the hibernate manual.


So I have <cache usage="read-only"/> set for the classes to cache and the set to cache. EnumerationOptins is one of them. I am also using the HashTableCache provider, at lest until I get this worked out.

When I run my HQL it hits the database everytime. I can see this in the MSSQL profiler, I can also see in my logs it's being placed into the cahce every time.

DEBUG [org.hibernate.engine.TwoPhaseLoad] resolving associations for org.EnumerationOptions#77]

DEBUG [org.hibernate.engine.TwoPhaseLoad] adding entity to second-level cache: [org.EnumerationOptions#77]

DEBUG [org.hibernate.cache.ReadOnlyCache] Caching: org.EnumerationOptions#77

DEBUG [org.hibernate.engine.TwoPhaseLoad]
done materializing entity [org.EnumerationOptions#77]

So requesting 10 of the same item hits the database 10 times per the profiler, and per the logs is cached 10 times.

I haved tried with with session.beginTransaction() with a UserTransaction and with nether. Always the same.

The only thing I can see that might be causing the caching to fail is which might be a a problem is my jboss config.

DEBUG [org.jboss.resource.connectionmanager.TxConnectionManager] Unfinished local transaction was rolled back.org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@15619c[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@6370fa handles=0 lastUse=1153852050070 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@8e6de9 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@d1f5ed xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@68ad7d txSync=null]

Thats really all I have to go on everything else looks correct.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 31, 2006 5:12 pm 
Newbie

Joined: Fri Jun 02, 2006 2:49 pm
Posts: 13
This was actuly being caused by a error in the way we where using hashCodes. You can see more here.

http://forum.hibernate.org/viewtopic.ph ... 33#2316101


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.