File tree Expand file tree Collapse file tree
APIJSONORM/src/main/java/apijson/orm Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -764,13 +764,17 @@ public void setTransactionIsolation(int transactionIsolation) {
764764 }
765765
766766 @ Override
767+ private boolean setIsolationStatus = false ; //设置事务等级
767768 public void begin (int transactionIsolation ) throws SQLException {
768769 Log .d ("\n \n " + TAG , "<<<<<<<<<<<<<< TRANSACTION begin transactionIsolation = " + transactionIsolation + " >>>>>>>>>>>>>>>>>>>>>>> \n \n " );
769770 //不做判断,如果掩盖了问题,调用层都不知道为啥事务没有提交成功
770771 // if (connection == null || connection.isClosed()) {
771772 // return;
772773 // }
773- connection .setTransactionIsolation (transactionIsolation );
774+ if (! this .setIsolationStatus ){ //只设置一次Isolation等级 PG重复设置事务等级会报错
775+ connection .setTransactionIsolation (transactionIsolation );
776+ }
777+ this .setIsolationStatus =true ;
774778 connection .setAutoCommit (false ); //java.sql.SQLException: Can''t call commit when autocommit=true
775779 }
776780 @ Override
You can’t perform that action at this time.
0 commit comments