[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5519) VersionedItem should not extend Item, otherwise query cache are confusing

Galder Zamarreno (JIRA) noreply at atlassian.com
Tue Aug 31 12:04:18 EDT 2010


VersionedItem should not extend Item, otherwise query cache are confusing
-------------------------------------------------------------------------

                 Key: HHH-5519
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5519
             Project: Hibernate Core
          Issue Type: Bug
          Components: caching (L2)
    Affects Versions: 3.6.0.Beta3, 3.5.5
            Reporter: Galder Zamarreno
            Assignee: Galder Zamarreno
             Fix For: 3.6.0.Beta4, 3.5.6


Fix org.hibernate.test.cache.infinispan.functional.BasicTransactionalTestCase.testQueryCache failure:

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. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list