瀏覽代碼

* Fix bug ID #0036148

git-svn-id: trunk@43154 -
michael 5 年之前
父節點
當前提交
e67989a8e8
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      packages/fcl-db/src/sqldb/sqldb.pp

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

@@ -2410,8 +2410,11 @@ begin
     CloseDataSets;
     If LogEvent(detCommit) then
       Log(detCommit,SCommitting);
-    // FTrans=Nil for the case of forced close.
-    if (FTrans=Nil) or (stoUseImplicit in Options) or SQLConnection.AttemptCommit(FTrans) then
+    // 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.
+    if (stoUseImplicit in Options) or SQLConnection.AttemptCommit(FTrans) or (FTrans=Nil) then
       begin
       CloseTrans;
       FreeAndNil(FTrans);