From 0e5b61167bf59e26bf3791b1a03f976ecf0798c7 Mon Sep 17 00:00:00 2001 From: wenshao Date: Wed, 25 Jul 2012 09:45:37 +0800 Subject: [PATCH 1/2] bug fixed for alibaba-cobar-postgresql --- .../alibaba/druid/pool/ConnectionHolder.java | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/alibaba/druid/pool/ConnectionHolder.java b/src/main/java/com/alibaba/druid/pool/ConnectionHolder.java index c6c619df53..c7aaeee930 100644 --- a/src/main/java/com/alibaba/druid/pool/ConnectionHolder.java +++ b/src/main/java/com/alibaba/druid/pool/ConnectionHolder.java @@ -66,16 +66,20 @@ public final class ConnectionHolder { this.connecttimeMillis = System.currentTimeMillis(); this.lastActiveTimeMillis = connecttimeMillis; - this.defaultReadOnly = conn.isReadOnly(); - this.defaultHoldability = conn.getHoldability(); - this.defaultTransactionIsolation = conn.getTransactionIsolation(); - this.defaultAutoCommit = conn.getAutoCommit(); - - this.underlyingAutoCommit = defaultAutoCommit; - this.underlyingHoldability = defaultHoldability; - this.underlyingTransactionIsolation = defaultTransactionIsolation; - this.underlyingTransactionIsolation = defaultTransactionIsolation; - + this.underlyingAutoCommit = conn.getAutoCommit(); + this.underlyingHoldability = conn.getHoldability(); + this.underlyingReadOnly = conn.isReadOnly(); + try { + this.underlyingTransactionIsolation = conn.getTransactionIsolation(); + } catch (SQLException e) { + if ("com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException".equals(e.getClass().getName())); + } + + this.defaultHoldability = underlyingHoldability; + this.defaultTransactionIsolation = underlyingTransactionIsolation; + this.defaultAutoCommit = underlyingAutoCommit; + this.defaultReadOnly = underlyingReadOnly; + statementPool = null; } From 805d23ccc662630a1284a303b6da5463c87110a8 Mon Sep 17 00:00:00 2001 From: wenshao Date: Wed, 25 Jul 2012 10:10:34 +0800 Subject: [PATCH 2/2] add code format files --- doc/alibaba-oss-code-format.xml | 279 +++++++++++++++++++++++++++++ doc/alibaba-oss-code-templates.xml | 37 ++++ 2 files changed, 316 insertions(+) create mode 100644 doc/alibaba-oss-code-format.xml create mode 100644 doc/alibaba-oss-code-templates.xml diff --git a/doc/alibaba-oss-code-format.xml b/doc/alibaba-oss-code-format.xml new file mode 100644 index 0000000000..914899ff6a --- /dev/null +++ b/doc/alibaba-oss-code-format.xml @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/alibaba-oss-code-templates.xml b/doc/alibaba-oss-code-templates.xml new file mode 100644 index 0000000000..fbbc190f47 --- /dev/null +++ b/doc/alibaba-oss-code-templates.xml @@ -0,0 +1,37 @@ + \ No newline at end of file