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

[GSS](7.2.z) WFLY-11991 - Applications that extend certain Hibernate classes should be updated to use type SharedSessionContractImplementor instead of SessionImplementor

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 7.2.3.CR1, 7.2.3.GA
    • 7.2.0.GA
    • JPA/Hibernate
    • Red Hat JBoss Enterprise Application Platform
      7.2.0.GA

      The idea is to transform any class method parameter of type org.hibernate.engine.spi.SessionImplementor, in user application, to instead use type org.hibernate.engine.spi.SharedSessionContractImplementor.

      The above is done for any application class that has any of the following Hibernate classes as its super class:

      org.hibernate.usertype.UserType
      org.hibernate.usertype.CompositeUserType
      org.hibernate.usertype.UserCollectionType
      org.hibernate.usertype.UserVersionType
      org.hibernate.type.Type
      org.hibernate.type.SingleColumnType
      org.hibernate.type.AbstractStandardBasicType
      org.hibernate.type.ProcedureParameterExtractionAware
      org.hibernate.type.ProcedureParameterNamedBinder
      org.hibernate.type.VersionType
      org.hibernate.collection.spi.PersistentCollection
      

      The code change is required to handle application classes like: https://github.com/simkam/wildfly/compare/hibernate_transformer.

      The test case change is adding an internalNullSafeGet method that should also be transformed to use the SharedSessionContractImplementor type but was not, which led to an application failure with code:

       public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
              return internalNullSafeGet(rs, names, session, owner);
          }
      
          private Object internalNullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
              internalSessionImplementorUsingMethod(session);
              session.isTransactionInProgress();
              int result = rs.getInt( names[0] );
              if ( rs.wasNull() ) return null;
              return State.values()[result];
          }
      }
      

              rhn-support-ivassile Ilia Vassilev
              rhn-support-toross Tom Ross (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: