ASF Bugzilla – Attachment 35232 Details for
Bug 61425
all idle connections become '<IDLE> in transaction' when the 'testWhileIdle' is set to 'true' and 'defaultAutoCommit' is set to 'false'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Attaching a simple patch to commit/rollback the connection.
file_61425.txt (text/plain), 1006 bytes, created by
WangZheng
on 2017-08-16 12:49:19 UTC
(
hide
)
Description:
Attaching a simple patch to commit/rollback the connection.
Filename:
MIME Type:
Creator:
WangZheng
Created:
2017-08-16 12:49:19 UTC
Size:
1006 bytes
patch
obsolete
>diff --git a/org/apache/tomcat/jdbc/pool/PooledConnection.java b/org/apache/tomcat/jdbc/pool/PooledConnection.java >index c833209..4615abf 100644 >--- a/org/apache/tomcat/jdbc/pool/PooledConnection.java >+++ b/org/apache/tomcat/jdbc/pool/PooledConnection.java >@@ -541,6 +541,22 @@ public class PooledConnection { > }^M > if (stmt!=null)^M > try { stmt.close();} catch (Exception ignore2){/*NOOP*/}^M >+^M >+ try {^M >+ if(!connection.getAutoCommit()) {^M >+ connection.rollback();^M >+ }^M >+ } catch (SQLException e) {^M >+ // do nothing^M >+ }^M >+ } finally {^M >+ try {^M >+ if(!connection.getAutoCommit()) {^M >+ connection.commit();^M >+ }^M >+ } catch (SQLException e) {^M >+ // do nothing^M >+ }^M > }^M > return false;^M > } //validate
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 61425
: 35232 |
35233