bug fixed for multi-savepoint

This commit is contained in:
wenshao
2012-11-24 22:17:29 +08:00
parent e70079eeb1
commit 78e31a1c16
12 changed files with 329 additions and 19 deletions
@@ -736,7 +736,7 @@ public class DruidPooledConnection implements javax.sql.PooledConnection, Connec
} catch (SQLException ex) {
handleException(ex);
} finally {
handleEndTransaction(dataSource);
handleEndTransaction(dataSource, null);
}
}
@@ -762,7 +762,7 @@ public class DruidPooledConnection implements javax.sql.PooledConnection, Connec
} catch (SQLException ex) {
handleException(ex);
} finally {
handleEndTransaction(dataSource);
handleEndTransaction(dataSource, null);
}
}
@@ -787,12 +787,12 @@ public class DruidPooledConnection implements javax.sql.PooledConnection, Connec
} catch (SQLException ex) {
handleException(ex);
} finally {
handleEndTransaction(dataSource);
handleEndTransaction(dataSource, savepoint);
}
}
private void handleEndTransaction(DruidAbstractDataSource dataSource) {
if (transactionInfo != null) {
private void handleEndTransaction(DruidAbstractDataSource dataSource, Savepoint savepoint) {
if (transactionInfo != null && savepoint == null) {
transactionInfo.setEndTimeMillis();
long transactionMillis = transactionInfo.getEndTimeMillis() - transactionInfo.getStartTimeMillis();