Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any reason to buffer local views?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00458169
Message ID:
00458233
Vues:
19
PMFJI,

>1. So do you always have to issue a tableupdate to commit changes to a view?

Yes, but if a view is row buffered, moving the record pointer will implicitly issue a TABLEUPDATE() for you. This may not be a good idea, as you have no control over the update (like whether or not it is successful). So many developers generally work with views in table buffered mode. In table buffered mode, you can move the record pointer at will, then issue the TABLEUPDATE() when you are ready.

The only advantage I know of to row buffering a view is when you are indexing the view. So I generally open a view in row buffered mode (NODATA), index, switch to table buffering, then REQUERY(). All REQUERies after that will utilize the existing index.

>2. Is the view results stored on the local machine or in the actual db? Can two users have the view open with different results at the same time?

The results are stored on the local machine, either as a cursor in memory or on disk. VFP handles this, so you don't have to worry about it. Yes, multiple users can open a view at the same time, all with different results.

There is a problem with views though, in that the view record in the DBC is temporary locked when the view is opened. If two users are opening the view at the same time, one may fail. So many developers put their views in a separate DBC, and keep that DBC on the local machine. So there is one DBC on the server for the tables, and each user has their own copy of the view DBC.

There is more info about views and DBCs at http://fox.wikis.com/
Chris McCandless
Red Sky Software
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform