DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8620>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8620

Closed Connection Exception on setAutoCommit





------- Additional Comments From [EMAIL PROTECTED]  2002-04-29 18:41 -------
(Just saw your comment, but since I already wrote this I'll post it anyway)

If I'm reading this correctly, you're closing your connection multiple times:

Your main loop calls ConnectionManager.commit(), which will call 
connection.close() in its finally block (or in ConnectionManager.rollback(), or 
both).

Your main loop also calls con.close(), which references the same connection.

Both calls will attempt to return the Connection to the pool, leading the pool 
to have multiple references to the same Connection, which will probably cause 
unexpected results.

You should probably either close the Connection directly of via 
ConnectionManager, but not both.

I would expect similiar results if you were to use Oracle directly (replace 
your DriverManager.getConnection("jdbc:apache:commons:dbcp:example") call 
with "jdbc:oracle:thin:scott/tiger@hostname:1521:mysid"). This is a generally 
useful heurstic when working with DBCP, get it working using the underlying 
driver directly, and then add the pooling behaviour.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to