Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Begin & End Transaction
Message
From
23/10/1997 15:24:14
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00056104
Message ID:
00056413
Views:
31
>>>Any idea why the tableupdate in the following code would fail. Note that this is a simplified version of my code. In my application I am actually updating five tables.
>>>
>>>SET MILTILOCKS ON
>>>SET EXCLUSIVE OFF
>>>SET DELETED ON
>>>
>>>USE mytable IN 0 shared
>>>=CURSORSETPROP("buffer", 5, "mytable")
>>>
>>>DELETE FROM mytable WHERE RECNO() <= 500
>>>
>>>BEGIN TRANSACTION
>>>IF !TABLEUPDATE(.T., .T., "mytable")
>>> ROLLBACK
>>> = TABLEREVERT(.T., "mytable")
>>>ELSE
>>> END TRANSACTION
>>>ENDIF
>>>
>>>The above test works when I only delete 499 records but when I try 500 it fails. Each record in mytable is 1426 bytes. I also have the same problem if referential integrity deletes the 500 records (cascading delete).
>>>
>
>Bill,
>
>A new clue! If mytable is located on our server (Novell 3.12) the tableupdate in the above code fails. If the table is located on my c: drive the tableupdate works. I tried the above example using vfp\samples\data\orditems and deleted 1500 records. It worked on my c: drive and not on the network.
>
>Any ideas,
>Shane

Hmmm . . . sounds like a network issue, but don't know what it could be. never encountered this before. If all else fails, might put the DELETE/TABLEUPDATE() in some sort of loop so you could update fewer records at a time. Not the way you would want to do it but . . . :-). you might sandwich it all in a TRANSACTION so you could ROLLBACK if it fails along the way. BTW, I may be wrong about this, but my understanding is that a ROLLBACK cancels ALL changes made during a TRANSACTION, so a TABLEREVERT() should not be necessary after a ROLLBACK. Hope you solve the problem.

Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform