We're upgrading the server from a4d 5r15 to 5r27 and ewre reviewing
changes along the way to r27.

Unless I missed it, the release notes do not show a change to
a4d.utils.unlockAndLoad wherein currently, transactions are
accommodated for GOTO RECORD.

I found the code change referenced in this list around Sept 2010 when
Steve Alex was reporting (to this list) an issue with transactions and
record numbers.

That change has made it into the current release (r27) and I found it
only because the current version fixes a missing end case statement in
the sample library file.

The reason for writing is in the diff file below.  It appears that
when the GOTO RECORD was pushed into the TRANSACTION test conditional,
an UNLOAD RECORD was added before changing the table status and then
reloaded again.

What is the purpose of that change?  Sorry, I'm asking because it may
be beyond my understanding.  And it requires us to do quite a bot of
testing if we accept the change.

I bring this up because normally I would have just updated the lib
file based on the docs listing only at he missing element.  So of
course let that be a lesson to us all to always double-check your code
and the external code on which your system relies.

Diff file:

--- /Users/Shared/projects/CLIENTS/HLCOM/hlcomdb11/trunk/Active4D/a4d.utils.a4l
+++ a4d.utils.a4l
@@ -41,15 +41,21 @@

 method "unlockAndLoad"($inTable; $inRecNum = -1; $inTimeoutURL = "";
$inTimeout = 2)
        
-       if ($inRecNum = -1)
-               $inRecNum := record number($inTable->)
-       end if
-       
-       c_boolean($timedOut; $readOnlyState)
-       $timedOut := false
-       $readOnlyState := read only state($inTable->)
-       read write($inTable->)
-       goto record($inTable->; $inRecNum)
+    if (not(execute in 4d("in transaction"; *)))
+        if ($inRecNum = -1)
+            $inRecNum := record number($inTable->)
+        end if
+
+        goto record($inTable->; $inRecNum)
+    end if
+
+    c_boolean($timedOut; $readOnlyState)
+    $timedOut := false
+    $readOnlyState := read only state($inTable->)
+    unload record($inTable->)
+    read write($inTable->)
+    load record($inTable->)
+
        c_longint($ticks)
        $ticks := tickcount
        
@@ -708,6 +714,7 @@
                        
        else
                return ($inText)
+       end case
                
 end method


osx.5.11, 4d 11.5 server, a4d 5r15

Thanks,

Michael Check
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to