mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
fix : get connection does not execute sql and return, add config 'checkExecuteTime', use 'lastExecTimeMillis' instead of 'lastActiveTimeMillis'
This commit is contained in:
@@ -712,12 +712,17 @@ public class DruidPooledConnection extends PoolableWrapper implements javax.sql.
|
||||
try {
|
||||
conn.setAutoCommit(autoCommit);
|
||||
holder.setUnderlyingAutoCommit(autoCommit);
|
||||
holder.setLastExecTimeMillis(System.currentTimeMillis());
|
||||
} catch (SQLException ex) {
|
||||
handleException(ex, null);
|
||||
}
|
||||
}
|
||||
|
||||
protected void transactionRecord(String sql) throws SQLException {
|
||||
if (holder != null) {
|
||||
holder.setLastExecTimeMillis(System.currentTimeMillis());
|
||||
}
|
||||
|
||||
if (transactionInfo == null && (!conn.getAutoCommit())) {
|
||||
DruidAbstractDataSource dataSource = holder.getDataSource();
|
||||
dataSource.incrementStartTransactionCount();
|
||||
|
||||
Reference in New Issue
Block a user