Basics - Troubleshooting Hibernate / JDBC Connection Pool Issue

后端 未结 6 2100
Happy的楠姐
Happy的楠姐 2021-02-13 05:39

What is Hibernate\'s responsibility in regards to database connections it gets from an underlying connection pool. Does it test to see if a connection is closed before it uses i

6条回答
  •  死守一世寂寞
    2021-02-13 06:32

    We usually work around this by using dbcp, and providing a validationQuery when definining our data source. Then, dbcp will verify the usability of pooled connections by issuing that query (and transparently recreate the connection should it no longer work), prior to returning them to the application.

    Check out http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html for more details.

提交回复
热议问题