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 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; }