Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Which way is better - one pass or multiple passes?
Message
De
19/03/2005 11:49:45
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
00997427
Message ID:
00997597
Vues:
14
>Hi everybody,
>
>I need to update one field in one table and two fields in another table in a batch process. I can not specify criteria in advance to receive a small subset of data. So, I'm thinking, what is better:
>
>retrieve data by small portions, say, 100 records. Make my updates, then save, then proceed. Or retrieve everything, do updates, then do one Save (commit). What do you think is the right approach in this situation?
>
>Keep in mind that I'm using VFP native data for a time being, though I hope to migrate to SQL Server soon.
>
>What would you suggest?

Depends on how granular you want your transaction to be, i.e. in case of failure, what do you want to roll back. If it's ALL of these that you want rolled back when one fails, then do them all at once - Fox (or SQL server, for that matter) will buffer your changes somewhere until you try to end transaction. So, it doesn't matter whether you do them in chunks or all together, the end transaction will still have to apply them all in the end.

If you can make it into a series of smaller transactions, then, well, I'd pull one transaction at a time - your buffers would be smaller, less memory used, less chance that your app may need to physically write some temp files to disk. Depends a lot on the size of your data, though.

So, there's no right or wrong approach - it just depends, as usual.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform