Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
USEing Views Produces 'Attempting To Lock'
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
USEing Views Produces 'Attempting To Lock'
Divers
Thread ID:
00645244
Message ID:
00645244
Vues:
40
Hi Everyone,

I have a VFP 6SP3 COM (multithread) dll that clients are using on a webserver. When testing server scalability by using WebStress, they reported all kinds of errors back to me. I ran the same test and discovered that the problem has to do with USEing views.

Apparently, when you USE a view, as in "USE database!view_name", VFP places a lock on the view record in the database container. Doesn't this seem to be a bug in VFP? Why would it need to place a lock in this scenario? Has anyone heard whether Microsoft is planning to fix this?

STEPS TO REPRODUCE PROBLEM:

Replace "mydatabase" with your database name
Replace "myview" with your view name.

Cut and paste and run in multiple VFP windows simultaneously:

OPEN DATABASE mydatabase
DO WHILE .T.
USE mydatabase!myview
REQUERY()
ENDDO

You should see "Attempting to Lock" periodically appear in the statusbar. This is because one window has the lock at the exact instance the view was being USEed in the other window.

Another way to do this is to USE your database.dbc in a VFP window, locate the View record and RLOCK() it. Then, in another VFP window, simply execute USE database!myview and it will say "Attempting to lock" until you release the lock in the first window.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform