org.hibernate.exception.GenericJDBCException: could not initialize a collection: [blah#1]

Spring JIRA | Vitaliy Geraymovych | 1 decade ago
  1. 0

    It seems that OpenSessionInView doesn't work with Weblogic 8.1 JTA/Hibernate. Here is the execution flow: DEBUG 10/24/06-16:24:03 BaseEvent [Finished spring execution.] DEBUG 10/24/06-16:24:03 JtaTransactionManager [Triggering beforeCommit synchronization] DEBUG 10/24/06-16:24:03 JtaTransactionManager [Triggering beforeCompletion synchronization] DEBUG 10/24/06-16:24:03 SessionImpl [setting flush mode to: NEVER] DEBUG 10/24/06-16:24:03 JtaTransactionManager [Initiating transaction commit] DEBUG 10/24/06-16:24:03 SessionImpl [before transaction completion] DEBUG 10/24/06-16:24:03 SessionImpl [after transaction completion] DEBUG 10/24/06-16:24:03 JtaTransactionManager [Triggering afterCompletion synchronization] DEBUG 10/24/06-16:24:03 SessionImpl [after transaction completion] DEBUG 10/24/06-16:24:03 TransactionSynchronizationManager [Clearing transaction synchronization] WARN 10/24/06-16:24:03 JDBCExceptionReporter [SQL Error: 0, SQLState: null] ERROR 10/24/06-16:24:03 JDBCExceptionReporter [The transaction is no longer active - status: 'Committed'. No further JDBC access is allowed within this transaction.] ERROR 10/24/06-16:24:03 BaseAction [Unexpected Exception] org.hibernate.exception.GenericJDBCException: could not initialize a collection: [blah#1] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.loadCollection(Loader.java:1926) at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:520) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60) .... Caused by: java.sql.SQLException: The transaction is no longer active - status: 'Committed'. No further JDBC access is allowed within this transaction. at weblogic.jdbc.wrapper.JTSConnection.checkIfRolledBack(JTSConnection.java:219) at weblogic.jdbc.wrapper.JTSConnection.checkConnection(JTSConnection.java:228) at weblogic.jdbc.wrapper.Connection.prepareStatement(Connection.java:356) .... at org.hibernate.loader.Loader.loadCollection(Loader.java:1919) ... 36 more DEBUG 10/24/06-16:24:04 TransactionSynchronizationManager [Removed value [org.springframework.orm.hibernate3.SessionHolder@14de991] for key [org.hibernate.impl.SessionFactoryImpl@1720f5] from thread [ExecuteThread: '24' for queue: 'weblogic.kernel.Default']] DEBUG 10/24/06-16:24:04 OpenSessionInViewFilter [Closing single Hibernate Session in OpenSessionInViewFilter] DEBUG 10/24/06-16:24:04 SessionFactoryUtils [Closing Hibernate Session] DEBUG 10/24/06-16:24:04 SessionImpl [closing session] DEBUG 10/24/06-16:24:04 SessionImpl [after transaction completion] Hibernate session and transaction manager configuration: <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"><ref bean="dataSource"/></property> <property name="configLocation"> <value>classpath:hibernate.cfg.xml</value> </property> <property name="entityInterceptor"> <ref local="hibernateInterceptor"/> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</prop> <prop key="hibernate.cache.provider_class">org.hibernate.cache.TreeCacheProvider</prop> <prop key="hibernate.cache.use_query_cache">true</prop> <prop key="hibernate.show_sql">false</prop> </props> </property> <property name="jtaTransactionManager"> <bean id="transactionManager.transactionManager" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"/> </property> </bean> <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"> </bean> Using HibernateTransactionManager solves the problem with OpenSessionInView but cannot be used as the final solution because of other dependencies on JTA. Spring documentation states full compatibilty between JTA transaction management and OpenSessionInView. I am looking for the clarification. Either I am missing something in my application context or Weblogic is not a supported platform for OpenSessionInView with JTA. I will gladly provide more information if necessary. Thanks, Vitaliy

    Spring JIRA | 1 decade ago | Vitaliy Geraymovych
    org.hibernate.exception.GenericJDBCException: could not initialize a collection: [blah#1]
  2. 0

    It seems that OpenSessionInView doesn't work with Weblogic 8.1 JTA/Hibernate. Here is the execution flow: DEBUG 10/24/06-16:24:03 BaseEvent [Finished spring execution.] DEBUG 10/24/06-16:24:03 JtaTransactionManager [Triggering beforeCommit synchronization] DEBUG 10/24/06-16:24:03 JtaTransactionManager [Triggering beforeCompletion synchronization] DEBUG 10/24/06-16:24:03 SessionImpl [setting flush mode to: NEVER] DEBUG 10/24/06-16:24:03 JtaTransactionManager [Initiating transaction commit] DEBUG 10/24/06-16:24:03 SessionImpl [before transaction completion] DEBUG 10/24/06-16:24:03 SessionImpl [after transaction completion] DEBUG 10/24/06-16:24:03 JtaTransactionManager [Triggering afterCompletion synchronization] DEBUG 10/24/06-16:24:03 SessionImpl [after transaction completion] DEBUG 10/24/06-16:24:03 TransactionSynchronizationManager [Clearing transaction synchronization] WARN 10/24/06-16:24:03 JDBCExceptionReporter [SQL Error: 0, SQLState: null] ERROR 10/24/06-16:24:03 JDBCExceptionReporter [The transaction is no longer active - status: 'Committed'. No further JDBC access is allowed within this transaction.] ERROR 10/24/06-16:24:03 BaseAction [Unexpected Exception] org.hibernate.exception.GenericJDBCException: could not initialize a collection: [blah#1] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.loadCollection(Loader.java:1926) at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:520) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60) .... Caused by: java.sql.SQLException: The transaction is no longer active - status: 'Committed'. No further JDBC access is allowed within this transaction. at weblogic.jdbc.wrapper.JTSConnection.checkIfRolledBack(JTSConnection.java:219) at weblogic.jdbc.wrapper.JTSConnection.checkConnection(JTSConnection.java:228) at weblogic.jdbc.wrapper.Connection.prepareStatement(Connection.java:356) .... at org.hibernate.loader.Loader.loadCollection(Loader.java:1919) ... 36 more DEBUG 10/24/06-16:24:04 TransactionSynchronizationManager [Removed value [org.springframework.orm.hibernate3.SessionHolder@14de991] for key [org.hibernate.impl.SessionFactoryImpl@1720f5] from thread [ExecuteThread: '24' for queue: 'weblogic.kernel.Default']] DEBUG 10/24/06-16:24:04 OpenSessionInViewFilter [Closing single Hibernate Session in OpenSessionInViewFilter] DEBUG 10/24/06-16:24:04 SessionFactoryUtils [Closing Hibernate Session] DEBUG 10/24/06-16:24:04 SessionImpl [closing session] DEBUG 10/24/06-16:24:04 SessionImpl [after transaction completion] Hibernate session and transaction manager configuration: <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"><ref bean="dataSource"/></property> <property name="configLocation"> <value>classpath:hibernate.cfg.xml</value> </property> <property name="entityInterceptor"> <ref local="hibernateInterceptor"/> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</prop> <prop key="hibernate.cache.provider_class">org.hibernate.cache.TreeCacheProvider</prop> <prop key="hibernate.cache.use_query_cache">true</prop> <prop key="hibernate.show_sql">false</prop> </props> </property> <property name="jtaTransactionManager"> <bean id="transactionManager.transactionManager" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"/> </property> </bean> <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"> </bean> Using HibernateTransactionManager solves the problem with OpenSessionInView but cannot be used as the final solution because of other dependencies on JTA. Spring documentation states full compatibilty between JTA transaction management and OpenSessionInView. I am looking for the clarification. Either I am missing something in my application context or Weblogic is not a supported platform for OpenSessionInView with JTA. I will gladly provide more information if necessary. Thanks, Vitaliy

    Spring JIRA | 1 decade ago | Vitaliy Geraymovych
    org.hibernate.exception.GenericJDBCException: could not initialize a collection: [blah#1]
  3. 0

    GenericJDBCException: could not initialize a collection:

    Stack Overflow | 3 years ago | AdiB
    org.hibernate.exception.GenericJDBCException: could not initialize a collection: [.......]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Problem with TransactionRolledbacking after 30 seconds.

    Oracle Community | 10 years ago | 666705
    org.hibernate.exception.GenericJDBCException: could not initialize a collection: [nl.selektvracht.svdepot.domein.Pakket.pakketstatushistories#161]
  6. 0

    cannot get connection: general error

    Stack Overflow | 2 years ago
    org.hibernate.exception.GenericJDBCException: Cannot open connection

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.hibernate.exception.GenericJDBCException

      could not initialize a collection: [blah#1]

      at org.hibernate.exception.SQLStateConverter.handledNonSpecificException()
    2. Hibernate
      AbstractCollectionPersister.initialize
      1. org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
      2. org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
      3. org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
      4. org.hibernate.loader.Loader.loadCollection(Loader.java:1926)
      5. org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
      6. org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:520)
      6 frames
    3. Hibernate
      DefaultInitializeCollectionEventListener.onInitializeCollection
      1. org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
      1 frame