mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
support useLocalSessionState config, default is true
This commit is contained in:
@@ -671,6 +671,14 @@ public class DruidPooledConnection extends PoolableWrapper implements javax.sql.
|
||||
@Override
|
||||
public void setAutoCommit(boolean autoCommit) throws SQLException {
|
||||
checkState();
|
||||
|
||||
boolean useLocalSessionState = holder.getDataSource().isUseLocalSessionState();
|
||||
|
||||
if (useLocalSessionState) {
|
||||
if (autoCommit == holder.isUnderlyingAutoCommit()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
conn.setAutoCommit(autoCommit);
|
||||
|
||||
Reference in New Issue
Block a user