support useLocalSessionState config, default is true

This commit is contained in:
wenshao
2013-04-15 17:07:51 +08:00
parent 7694391390
commit b1e563fa5f
3 changed files with 24 additions and 0 deletions
@@ -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);