Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-26156

[GSS](7.4.z) HHH-13179 - Unionsubclass 2nd level caching no longer works for XML mappings in 5.3 and 5.4

XMLWordPrintable

      Customer is reporting reduced performance due to HHH-13179.

       

      After updating an application that still uses XML mapping definition from 5.2 to 5.4 some requests suddenly started to take 10 times or even more time.

      If figured out that the 2nd level caching was no longer working for some classes. Those classes are using the unionsubclass mapping. Even multiple simple session.get(unionsubclass, id) (in multiple sessions) don't fetch the entity from the 2nd level cache anymore but always hit the database. But where it hurts most is if these entities are reference from a cached collection. In this case the performance is much worse than without any caching at all as each cache miss (which is everytime now) hits the database for each entity with the ID instead of selecting them all with a single select using the foreign key.

      After switching back to 5.2.17 the caching worked again as expected. I know that there were some changes regardging enabling caching on different levels in class hierarchies. But I didn't find anythign that says that the existing definitions must be changed and you cannot define any caching on the unionsubclass level anyway so I suppose this is a bug. When using annotations and MappedSuperclass it works as expected.

      The attached test case inserts 2 entities, one using HBM and unionsubclass and the other annotations and mappedsuperclass. Then it fetches them using session.get() in 3 separate sessions.

            rhn-support-ivassile Ilia Vassilev
            rhn-support-tcowhey TJ Cowhey
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: