Tomcat pool connection leaks preceded by "Pre-bound JDBC Connection found" / "No value for key [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" errors in EWS

Solution Unverified - Updated -

Issue

  • Repeating failures such as the following are observed

    [ajp-apr-127.0.0.1-8209-exec-12] 2016-09-16 14:14:07,351 EDT ... org.springframework.transaction.IllegalTransactionStateException: Pre-bound JDBC Connection found! JpaTransactionManager does not support running within DataSourceTransactionManager if told to manage the DataSource itself. It is recommended to use a single JpaTransactionManager for all transactions on a single DataSource, no matter whether JPA or JDBC access.
            at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:357)
            at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:372)
            ...
    ...
    [ajp-apr-127.0.0.1-8209-exec-12] 2016-09-16 14:15:04,561 EDT ... java.lang.IllegalStateException: No value for key [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean@18b256d6] bound to thread [ajp-apr-127.0.0.1-8209-exec-12]
            at org.springframework.transaction.support.TransactionSynchronizationManager.unbindResource(TransactionSynchronizationManager.java:209)
            at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:185)
            ...
    
  • Eventually, exceptions such as the following begin to occur

    [ajp-apr-127.0.0.1-8209-exec-1] 2016-09-16 14:28:46,518 EDT ... org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.tomcat.jdbc.pool.PoolExhaustedException: [ajp-apr-127.0.0.1-8209-exec-1] Timeout: Pool empty. Unable to fetch a connection in 30 seconds, none available[size:150; busy:150; idle:0; lastwait:30000].
    

Environment

  • Red Hat JBoss Enterprise Web Server (EWS) 2
  • Spring 3.2

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