The following error is thrown when wait_timeout value exceeded:
Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionException: JDBC begin failed:
---
Solution found by Ron Anderson:
>Finally found the problem. It is in dbcp 1.2.2 version.
>(see this bug
https://issues.apache.org/jira/browse/DBCP-244)
>
>The fix is to change dbcp version back to 1.2.1 (in POM). Worked like a
>champ for me after two days of screwing with various options.
>
>Very hard to replicate on a db with any load as the wait_timeout doesn't
>expire. Stopping and starting the mysqld service did work for me as long as
>I was the first to hit it. Otherwise someone else would see the ugly stack
>trace.
>
>Ron
Adding the following dependency to pom.xml seems to work--I'll be able to confirm this solution tomorrow.
<dependency>
<groupId>velocity-tools</groupId>
<artifactId>velocity-tools-generic</artifactId>
<version>1.2</version>
</dependency>
<commons.dbcp.version>1.2.1</commons.dbcp.version>
Then do a mvn clean and then mvn package to build new war from updated pom.