History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: APF-976
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Matt Raible
Reporter: Nathan Anderson
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
AppFuse

Exception thrown when database connection wait_timeout exceeded

Created: 09/Dec/07 01:23 AM   Updated: 03/May/08 10:32 PM
Component/s: Persistence Layer
Affects Version/s: 2.0.1
Fix Version/s: 2.0.2


 Description  « Hide
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>


 All   Comments   Change History   FishEye      Sort Order:
Ron Anderson - 09/Dec/07 12:11 PM
The solution that worked for me was to change the property at the bottom of the parent pom.xml to:

<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.

Nathan Anderson - 09/Dec/07 12:45 PM
heh... looks like I pasted the solution to the wrong problem.

I did put the correct dependency in my app's pom.xml:

        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.2.1</version>
     </dependency>

I tested this solution and received no stack trace after 12 hours of no use, so it appears to work as well.

Matt Raible - 03/May/08 10:32 PM
Thanks for figuring out the solution to this problem gents.