Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Table Buffering vs Row Buffering
Message
De
24/07/2001 12:22:58
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
 
À
24/07/2001 08:08:22
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00533841
Message ID:
00534474
Vues:
11
This message has been marked as a message which has helped to the initial question of the thread.
Renoir-

>Assume a buffered base table called Codes and two views called vCodes and vDetail. I normally do something like the following using Optimistic Row Buffering:
>
>
>If TableUpdate(.T.,.T.,'vDetail') = .F.
>     Tablerevert('vDetail')
>     Wait Window '  Save record Failed!  ' timeout 3
>Else
>     Tableupdate(.T.,.T.,'Codes')
>     Requery('vCodes')
>     Requery('vDetail')
>Endif
>
>
>If I just change the buffering settings to 5 instead of 3 do I have any other concerns or will it just happily start using table buffering?

Well, this little bit of code? No, since your forcing an update to all rows. But of course there's no way to say for the rest of your application.

FWIW, this is fairly brutish (not that I haven't done it this way, too). What if another user has made a change to a record? They just lost their changes.

Also, you need to check the return from the Codes update. It might fail.
IF TableUpdate OneTable
  IF TableUpdate AnotherTable
    Great!
  ELSE
    TableRevert, or give the user some message about the failure and a chance to revert.
  ENDIF
ELSE
    TableRevert, or give the user some message about the failure and a chance to revert.
ENDIF
Note that nesting these really implies a need for Transactions, as has been pointed out to you.

Always, always, always check the return from tableupdate.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform