fix: inner 595 (#2221) (#2227)

* fix: inner 595

* fix: inner 595

* fix: inner 595
This commit is contained in:
LUA
2020-11-03 14:16:34 +08:00
committed by GitHub
parent 7e57b18cac
commit b11322552c
2 changed files with 2 additions and 15 deletions

View File

@@ -129,15 +129,6 @@ public class RWSplitNonBlockingSession {
this.conn = bindConn;
}
public void unbindIfSafe(boolean safe) {
if (safe) {
this.conn.release();
this.conn = null;
} else {
unbindIfSafe();
}
}
public void unbindIfSafe() {
if (rwSplitService.isAutocommit() && !rwSplitService.isTxStart() && !rwSplitService.isLocked() &&
!rwSplitService.isInLoadData() &&

View File

@@ -71,7 +71,6 @@ public class RWSplitQueryHandler implements FrontendQueryHandler {
case RwSplitServerParse.ROLLBACK:
session.execute(true, (isSuccess, rwSplitService) -> {
rwSplitService.setTxStart(false);
rwSplitService.getSession().unbindIfSafe(true);
session.getService().singleTransactionsCount();
});
break;
@@ -109,11 +108,8 @@ public class RWSplitQueryHandler implements FrontendQueryHandler {
case RwSplitServerParse.GRANT:
case RwSplitServerParse.REVOKE:
return (isSuccess, rwSplitService) -> {
if (session.getService().isTxStart()) {
rwSplitService.setTxStart(false);
rwSplitService.getSession().unbindIfSafe(true);
session.getService().singleTransactionsCount();
}
rwSplitService.setTxStart(false);
session.getService().singleTransactionsCount();
};
default:
return null;