[hibernate-dev] org.hibernate.test.cache.infinispan.functional.BasicTransactionalTestCase.testQueryCache failure

Galder Zamarreño galder at jboss.org
Tue Aug 31 11:55:20 EDT 2010


Hi Steve,

The difference in behavior recently is the following: Hibernate has always treated VersionedItem and Item as two query translators for queries like "from Item". The difference is that in the past, the 2nd time a query was executed, VersionedItem query resulted on a query put whereas now it's a query hit. This leads to query hits being 2 instead of 1. 2 is probably correct if you consider VersionedItem to be an Item, which it is. In the past, VersionedItem query would have been considered a put, even the second time around and so query hit was only 1.

If you want to investigate further, simply have two entities, one extending each other and do 2 queries with "from X" where X is the top class. In 3.5.0, the first query resulted in two query puts and the second one resulted in 1 query put, 1 query hit. In trunk and 3.5.x now, the first query results in two query puts and the 2nd query in two query hits.

For my tests, I'm getting rid of this polymorphism to avoid testing stuff I don't need to be testing from an Infinispan perspective. 

Cheers, 
--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache




More information about the hibernate-dev mailing list