Bläddra i källkod

* Do not set the Transaction property of a TDatabase while assigning TSQLTransaction.Database when the TSQLTransaction is loaded from stream

git-svn-id: trunk@12680 -
joost 16 år sedan
förälder
incheckning
6ceb016593
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      packages/fcl-db/src/sqldb/sqldb.pp

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

@@ -779,7 +779,7 @@ begin
       with TSQLConnection(DataBase) do
       with TSQLConnection(DataBase) do
         if Transaction = self then Transaction := nil;
         if Transaction = self then Transaction := nil;
     inherited SetDatabase(Value);
     inherited SetDatabase(Value);
-    If Assigned(Database) then
+    If Assigned(Database) and not (csLoading in ComponentState) then
       If (TSQLConnection(DataBase).Transaction=Nil) then
       If (TSQLConnection(DataBase).Transaction=Nil) then
         TSQLConnection(DataBase).Transaction:=Self;
         TSQLConnection(DataBase).Transaction:=Self;
     end;
     end;