This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new d0d85baa1f5 Use primitive boolean in ConnectionSession (#18983)
d0d85baa1f5 is described below

commit d0d85baa1f541cb62c4d5a4e63cedb2cf0b8e618
Author: 吴伟杰 <[email protected]>
AuthorDate: Sun Jul 10 11:15:01 2022 +0800

    Use primitive boolean in ConnectionSession (#18983)
---
 .../proxy/backend/session/ConnectionSession.java   | 43 +---------------------
 1 file changed, 2 insertions(+), 41 deletions(-)

diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/session/ConnectionSession.java
 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/session/ConnectionSession.java
index 75b0254e603..11ee8452468 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/session/ConnectionSession.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/session/ConnectionSession.java
@@ -40,7 +40,6 @@ import 
org.apache.shardingsphere.transaction.core.TransactionType;
 
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicBoolean;
 
 /**
  * Connection session.
@@ -62,11 +61,9 @@ public final class ConnectionSession {
     
     private final AttributeMap attributeMap;
     
-    @Getter(AccessLevel.NONE)
-    private final AtomicBoolean autoCommit = new AtomicBoolean(true);
+    private volatile boolean autoCommit = true;
     
-    @Getter(AccessLevel.NONE)
-    private AtomicBoolean readOnly = new AtomicBoolean(false);
+    private volatile boolean readOnly;
     
     private TransactionIsolationLevel defaultIsolationLevel;
     
@@ -133,40 +130,4 @@ public final class ConnectionSession {
     public String getDefaultDatabaseName() {
         return databaseName;
     }
-    
-    /**
-     * Is autocommit.
-     *
-     * @return is autocommit
-     */
-    public boolean isAutoCommit() {
-        return autoCommit.get();
-    }
-    
-    /**
-     * Set autocommit.
-     *
-     * @param autoCommit autocommit
-     */
-    public void setAutoCommit(final boolean autoCommit) {
-        this.autoCommit.set(autoCommit);
-    }
-    
-    /**
-     * Is readonly.
-     *
-     * @return is readonly
-     */
-    public boolean isReadOnly() {
-        return readOnly.get();
-    }
-    
-    /**
-     * Set readonly.
-     *
-     * @param readOnly readonly
-     */
-    public void setReadOnly(final boolean readOnly) {
-        this.readOnly.set(readOnly);
-    }
 }

Reply via email to