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   Resolved: 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>


Ron Anderson added a comment - 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 added a comment - 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.

3123 by  Matt Raible (1 file)
03/May/08 10:31 PM (27 months, 14 days ago)
APF-976: Reverted to Commons DBCP 1.2.1 since 1.2.2 causes exception when database connection wait_timeout is exceeded.
appfuse: trunk/pom.xml 3123 history download (+1 -1) diffs

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

Matt Raible made changes - 03/May/08 10:32 PM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
3128 by  Matt Raible (1 file)
03/May/08 11:30 PM (27 months, 14 days ago)
APF-976: Use commons-dbcp 1.2.2 with Tapestry since there's a NoSuchMethodError if 1.2.1 is used.
appfuse: trunk/web/tapestry/pom.xml 3128 history download (+6 -0) diffs