Prechádzať zdrojové kódy

* Call UpdateServiceIndexDefs before Execute, to avoid problems with databases which do not allow processing multiple recordsets at a time (MS SQL, bug #13241)

git-svn-id: trunk@13090 -
joost 16 rokov pred
rodič
commit
ce55400037
1 zmenil súbory, kde vykonal 5 pridanie a 1 odobranie
  1. 5 1
      packages/fcl-db/src/sqldb/sqldb.pp

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

@@ -1219,6 +1219,11 @@ begin
     begin
     if not ReadFromFile then
       begin
+      // Call UpdateServerIndexDefs before Execute, to avoid problems with connections
+      // which do not allow processing multiple recordsets at a time. (Microsoft
+      // calls this MARS, see bug 13241)
+      if DefaultFields and FUpdateable and FusePrimaryKeyAsKey then
+        UpdateServerIndexDefs;
       Execute;
       // InternalInitFieldDef is only called after a prepare. i.e. not twice if
       // a dataset is opened - closed - opened.
@@ -1231,7 +1236,6 @@ begin
           begin
           if FusePrimaryKeyAsKey then
             begin
-            UpdateServerIndexDefs;
             for tel := 0 to ServerIndexDefs.count-1 do
               begin
               if ixPrimary in ServerIndexDefs[tel].options then