소스 검색

* RollBack needs same changes as commit for broken connection

git-svn-id: trunk@43156 -
michael 6 년 전
부모
커밋
bbc6ac1349
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      packages/fcl-db/src/sqldb/sqldb.pp

+ 5 - 1
packages/fcl-db/src/sqldb/sqldb.pp

@@ -2441,8 +2441,12 @@ begin
     CloseDataSets;
     If LogEvent(detRollback) then
       Log(detRollback,SRollingBack);
+    // The inherited closetrans must always be called.
+    // So the last (FTrans=Nil) is for the case of forced close. (Bug IDs 35246 and 33737)
+    // Order is important:
+    // some connections do not have FTrans, but they must still go through AttemptCommit.
     // FTrans=Nil for the case of forced close.
-    if (FTrans=Nil) or SQLConnection.AttemptRollBack(FTrans) then
+    if SQLConnection.AttemptRollBack(FTrans) or (FTrans=Nil) then
       begin
       CloseTrans;
       FreeAndNil(FTrans);