"Connection is not associated with a managed connection" and "result set is closed" errors with Spring + Hibernate in EAP 6

Solution Verified - Updated -

Issue

  • Using nested queries (e.g. Hibernate query during a JdbcTemplate query OR nested Hibernate queries)
  • Using org.springframework.orm.jpa.JpaTransactionManager for the transaction manager
  • Outer queries fail with exceptions such as the following:
java.sql.SQLException: Connection is not associated with a managed connection.org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6
java.sql.SQLException: The result set is closed.

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 6
  • Hibernate 4
  • Spring

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.