"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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content