Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-4175

HHH-5163 Bug when applying a ResultTransformer on a cacheable projection based criteria

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: EAP 5.0.0.CR5, EAP 5.0.1.CR2, EAP 5.0.1, EAP_EWP 5.1.0
    • Fix Version/s: EAP_EWP 5.1.1
    • Component/s: Hibernate
    • Labels:
      None
    • Affects:
      Release Notes
    • Release Notes Text:
      Hide
      When Hibernate executed a cacheable query using a <classname>ResultTransformer</classname>, it attempted to cache the results after applying the <classname>ResultTransformer</classname>. However, the data might be modified so that Hibernate could not read it. In this case, a <exceptionname>ClassCastException</exceptionname> would occur when attempting to cache the results.

      This issue is fixed by introducing three new classes to the API:
      org.hibernate.transform.AliasedTupleSubsetResultTransformer
      org.hibernate.transform.CacheableResultTransformer
      org.hibernate.transform.TupleSubsetResultTransformer

      Review the Javadoc for Hibernate for more details.
      Show
      When Hibernate executed a cacheable query using a <classname>ResultTransformer</classname>, it attempted to cache the results after applying the <classname>ResultTransformer</classname>. However, the data might be modified so that Hibernate could not read it. In this case, a <exceptionname>ClassCastException</exceptionname> would occur when attempting to cache the results. This issue is fixed by introducing three new classes to the API: org.hibernate.transform.AliasedTupleSubsetResultTransformer org.hibernate.transform.CacheableResultTransformer org.hibernate.transform.TupleSubsetResultTransformer Review the Javadoc for Hibernate for more details.
    • Release Notes Docs Status:
      Documented as Resolved Issue

      Description

      Typically following code will raise a CCE
      Criteria crit = session.createCriteria(MyEntity.class);
      crit.setProjection( Projections.projectionList()
      .add( Projections.alias(Projections.property("description"), "description" ))
      .add( Projections.alias(Projections.property("id"), "id" ))
      );
      crit.setCacheable(true);
      crit.setResultTransformer(Transformers.aliasToBean(MyEntity.class));
      List results = crit.list();

      java.lang.ClassCastException: org.hibernate.test.case756453.MyEntity
      at org.hibernate.cache.StandardQueryCache.put(StandardQueryCache.java:106)
      at org.hibernate.loader.Loader.putResultInQueryCache(Loader.java:2208)
      at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2159)
      at org.hibernate.loader.Loader.list(Loader.java:2117)
      at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:118)
      at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1596)
      at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)

      There is a problem between the real cached value and the expected cached value (maybe the transformer is applied too soon or query cache is not aware the cached value is already transformed,...).

      http://opensource.atlassian.com/projects/hibernate/browse/HHH-5163

        Gliffy Diagrams

          Issue Links

            Activity

            AnthonyHib Anthony Patricio created issue -
            AnthonyHib Anthony Patricio made changes -
            Field Original Value New Value
            Attachment CacheableCriteria.zip [ 12333972 ]
            AnthonyHib Anthony Patricio made changes -
            Fix Version/s EAP 5.1.0 [ 12313895 ]
            Fix Version/s EAP 5.0.1.CR3 [ 12314775 ]
            stliu Strong Liu made changes -
            Summary Bug when applying a ResultTransformer on a cacheable projection based criteria HHH-5163 Bug when applying a ResultTransformer on a cacheable projection based criteria
            Description Typically following code will raise a CCE
            Criteria crit = session.createCriteria(MyEntity.class);
            crit.setProjection( Projections.projectionList()
             .add( Projections.alias(Projections.property("description"), "description" ))
             .add( Projections.alias(Projections.property("id"), "id" ))
            );
            crit.setCacheable(true);
            crit.setResultTransformer(Transformers.aliasToBean(MyEntity.class));
            List results = crit.list();


            java.lang.ClassCastException: org.hibernate.test.case756453.MyEntity
            at org.hibernate.cache.StandardQueryCache.put(StandardQueryCache.java:106)
            at org.hibernate.loader.Loader.putResultInQueryCache(Loader.java:2208)
            at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2159)
            at org.hibernate.loader.Loader.list(Loader.java:2117)
            at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:118)
            at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1596)
            at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)


            There is a problem between the real cached value and the expected cached value (maybe the transformer is applied too soon or query cache is not aware the cached value is already transformed,...).
            Typically following code will raise a CCE
            Criteria crit = session.createCriteria(MyEntity.class);
            crit.setProjection( Projections.projectionList()
             .add( Projections.alias(Projections.property("description"), "description" ))
             .add( Projections.alias(Projections.property("id"), "id" ))
            );
            crit.setCacheable(true);
            crit.setResultTransformer(Transformers.aliasToBean(MyEntity.class));
            List results = crit.list();


            java.lang.ClassCastException: org.hibernate.test.case756453.MyEntity
            at org.hibernate.cache.StandardQueryCache.put(StandardQueryCache.java:106)
            at org.hibernate.loader.Loader.putResultInQueryCache(Loader.java:2208)
            at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2159)
            at org.hibernate.loader.Loader.list(Loader.java:2117)
            at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:118)
            at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1596)
            at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)


            There is a problem between the real cached value and the expected cached value (maybe the transformer is applied too soon or query cache is not aware the cached value is already transformed,...).

            http://opensource.atlassian.com/projects/hibernate/browse/HHH-5163
            Affects [Release Notes]
            stliu Strong Liu made changes -
            Fix Version/s 4.2.0.GA_CP10 [ 12314385 ]
            Fix Version/s 4.3.0.GA_CP09 [ 12314386 ]
            Affects Version/s EAP 5.0.1 [ 12314461 ]
            Affects Version/s  4.2.0.GA_CP09 [ 12313945 ]
            Affects Version/s  4.3.0.GA_CP08 [ 12313946 ]
            stliu Strong Liu made changes -
            Link This issue is a dependency of JBPAPP-4320 [ JBPAPP-4320 ]
            stliu Strong Liu made changes -
            Fix Version/s TBD [ 12312115 ]
            Fix Version/s EAP/EWP 5.1.0 [ 12314384 ]
            Fix Version/s 4.2.0.GA_CP10 [ 12314385 ]
            Fix Version/s 4.3.0.GA_CP09 [ 12314386 ]
            Affects Version/s EAP/EWP 5.1.0 [ 12314384 ]
            Affects Version/s  4.2.0.GA_CP09 [ 12313945 ]
            Affects Version/s  4.3.0.GA_CP08 [ 12313946 ]
            atangrin Anne-Louise Tangring made changes -
            Fix Version/s TBD EAP 5 [ 12315037 ]
            Fix Version/s TBD [ 12312115 ]
            stliu Strong Liu made changes -
            Link This issue is a dependency of JBPAPP-4695 [ JBPAPP-4695 ]
            stliu Strong Liu made changes -
            Link This issue is a dependency of JBPAPP-4695 [ JBPAPP-4695 ]
            stliu Strong Liu made changes -
            Fix Version/s EAP_EWP 5.1.1 [ 12315036 ]
            Fix Version/s TBD EAP 5 [ 12315037 ]
            stliu Strong Liu made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Release Notes Docs Status Not Yet Documented
            Release Notes Text When Hibernate executed a cacheable query using a <classname>ResultTransformer</classname>, it attempted to cache the results after applying the <classname>ResultTransformer</classname>. However, the data might be modified so that Hibernate could not read it. In this case, a <exceptionname>ClassCastException</exceptionname> would occur when attempting to cache the results.

            This issue is fixed by introducing three new API, org.hibernate.transform.AliasedTupleSubsetResultTransformer, org.hibernate.transform.CacheableResultTransformer, org.hibernate.transform.TupleSubsetResultTransformer, check the javadocs for more details.
            Resolution Done [ 1 ]
            mistysj Misty Stanley-Jones made changes -
            Release Notes Docs Status Not Yet Documented Documented as Resolved Issue
            Writer misty@redhat.com
            mistysj Misty Stanley-Jones made changes -
            Release Notes Text When Hibernate executed a cacheable query using a <classname>ResultTransformer</classname>, it attempted to cache the results after applying the <classname>ResultTransformer</classname>. However, the data might be modified so that Hibernate could not read it. In this case, a <exceptionname>ClassCastException</exceptionname> would occur when attempting to cache the results.

            This issue is fixed by introducing three new API, org.hibernate.transform.AliasedTupleSubsetResultTransformer, org.hibernate.transform.CacheableResultTransformer, org.hibernate.transform.TupleSubsetResultTransformer, check the javadocs for more details.
            When Hibernate executed a cacheable query using a <classname>ResultTransformer</classname>, it attempted to cache the results after applying the <classname>ResultTransformer</classname>. However, the data might be modified so that Hibernate could not read it. In this case, a <exceptionname>ClassCastException</exceptionname> would occur when attempting to cache the results.

            This issue is fixed by introducing three new classes to the API: org.hibernate.transform.AliasedTupleSubsetResultTransformer, org.hibernate.transform.CacheableResultTransformer, org.hibernate.transform.TupleSubsetResultTransformer. Review the Javadoc for Hibernate, for more details.
            mistysj Misty Stanley-Jones made changes -
            Release Notes Text When Hibernate executed a cacheable query using a <classname>ResultTransformer</classname>, it attempted to cache the results after applying the <classname>ResultTransformer</classname>. However, the data might be modified so that Hibernate could not read it. In this case, a <exceptionname>ClassCastException</exceptionname> would occur when attempting to cache the results.

            This issue is fixed by introducing three new classes to the API: org.hibernate.transform.AliasedTupleSubsetResultTransformer, org.hibernate.transform.CacheableResultTransformer, org.hibernate.transform.TupleSubsetResultTransformer. Review the Javadoc for Hibernate, for more details.
            When Hibernate executed a cacheable query using a <classname>ResultTransformer</classname>, it attempted to cache the results after applying the <classname>ResultTransformer</classname>. However, the data might be modified so that Hibernate could not read it. In this case, a <exceptionname>ClassCastException</exceptionname> would occur when attempting to cache the results.

            This issue is fixed by introducing three new classes to the API:
            org.hibernate.transform.AliasedTupleSubsetResultTransformer
            org.hibernate.transform.CacheableResultTransformer,
            org.hibernate.transform.TupleSubsetResultTransformer.

            Review the Javadoc for Hibernate for more details.
            mistysj Misty Stanley-Jones made changes -
            Release Notes Text When Hibernate executed a cacheable query using a <classname>ResultTransformer</classname>, it attempted to cache the results after applying the <classname>ResultTransformer</classname>. However, the data might be modified so that Hibernate could not read it. In this case, a <exceptionname>ClassCastException</exceptionname> would occur when attempting to cache the results.

            This issue is fixed by introducing three new classes to the API:
            org.hibernate.transform.AliasedTupleSubsetResultTransformer
            org.hibernate.transform.CacheableResultTransformer,
            org.hibernate.transform.TupleSubsetResultTransformer.

            Review the Javadoc for Hibernate for more details.
            When Hibernate executed a cacheable query using a <classname>ResultTransformer</classname>, it attempted to cache the results after applying the <classname>ResultTransformer</classname>. However, the data might be modified so that Hibernate could not read it. In this case, a <exceptionname>ClassCastException</exceptionname> would occur when attempting to cache the results.

            This issue is fixed by introducing three new classes to the API:
            org.hibernate.transform.AliasedTupleSubsetResultTransformer
            org.hibernate.transform.CacheableResultTransformer
            org.hibernate.transform.TupleSubsetResultTransformer

            Review the Javadoc for Hibernate for more details.
            juraci.costa Juraci Paixão Kröhling made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

              People

              • Assignee:
                stliu Strong Liu
                Reporter:
                AnthonyHib Anthony Patricio
                Writer:
                Misty Stanley-Jones
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Development