Bugs item #551762, was opened at 2002-05-03 11:03
Message generated for change (Comment added) made by letiemble
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=376685aid=551762group_id=22866
Category: JBossServer
Group: v2.4 (stable)
Status: Closed
Resolution: Invalid
Priority: 5
Submitted By: Matt Goodall (mgoodall)
Assigned to: Laurent Etiemble (letiemble)
Summary: Connection pool wrapper problems
Initial Comment:
Statement and ResultSet objects that belong to a
connection from a pool are not aware of the pool.
Statement.getConnection() returns the *real*
connection which can then be closed. Sample code to
demonstrate the error:
Connection conn = datasource.getConnection();
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery();
Statement stmt2 = rs.getStatement();
Connection conn2 = stmt2.getConnection();
At this point conn != conn2, conn2 is the real
connection that conn wraps.
Symptoms are that the connection is actually closed
and not simply returned to the pool. When the
connection is closed a commit takes places even though
that may be in the middle of a transaction. If you're
using container managed transactions you'll also get a
HeuristicRollbackException.
Fixing the problem will involve correctly wrapping the
pool managed Statement and ResultSet objects.
--
Comment By: Laurent Etiemble (letiemble)
Date: 2003-10-10 10:43
Message:
Logged In: YES
user_id=437455
Statement and ResultSet are not to be pooled or wrapped.
The correct way to use is :
- get a Connection (fetched from the pool)
- create a Statement
- get a ResultSet
- close the ResultSet
- close the Statement
- close the connection (returned to the pool)
--
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=376685aid=551762group_id=22866
---
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
___
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development