File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
APIJSONORM/src/main/java/apijson/orm Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -763,18 +763,18 @@ public void setTransactionIsolation(int transactionIsolation) {
763763 this .transactionIsolation = transactionIsolation ;
764764 }
765765
766+ private boolean isIsolationStatusSet = false ; //已设置事务等级
766767 @ Override
767- private boolean setIsolationStatus = false ; //设置事务等级
768768 public void begin (int transactionIsolation ) throws SQLException {
769769 Log .d ("\n \n " + TAG , "<<<<<<<<<<<<<< TRANSACTION begin transactionIsolation = " + transactionIsolation + " >>>>>>>>>>>>>>>>>>>>>>> \n \n " );
770770 //不做判断,如果掩盖了问题,调用层都不知道为啥事务没有提交成功
771771 // if (connection == null || connection.isClosed()) {
772772 // return;
773773 // }
774- if (! this .setIsolationStatus ){ //只设置一次Isolation等级 PG重复设置事务等级会报错
774+ if (! isIsolationStatusSet ) { //只设置一次Isolation等级 PG重复设置事务等级会报错
775+ isIsolationStatusSet = true ;
775776 connection .setTransactionIsolation (transactionIsolation );
776777 }
777- this .setIsolationStatus =true ;
778778 connection .setAutoCommit (false ); //java.sql.SQLException: Can''t call commit when autocommit=true
779779 }
780780 @ Override
You can’t perform that action at this time.
0 commit comments