Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

View + lock

Status
Not open for further replies.

MdVries

Programmer
Apr 16, 2003
47
NL
If i select an view, does my source table get locked?

I have made an view called "view_partij" of my partij.dbf

I use the code "select * from view_partij.

? isflocked("view_partij") is True
? isflocked("partij") is false

Maybe other lockes are set when i select my view_partij.
 

As both Geoff and I explained in thread184-1221360, just doing a SELECT does not lock a table by default. A view is nothing more than a SELECT statement in a fancy wrapper.

But you should check that the table hasn't been opened exclusively, and you haven't got SET LOCK ON. (In any case, I don't think SET LOCK ON affects a SELECT -- but it does affect COPY TO.)

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
I am wondering if the problem you are encountering might be due to having EXCLUSIVE set TRUE - whether by default or by intent as part of each user's work environment settings.

You can look in the Options setting for your VFP to see what you might have as your Default setting.

Or somewhere near the start of your program you can intentionally issue the command:
Code:
SET EXCLUSIVE OFF

Also, as Mike suggests above, ensure that you are not opening your tables with the EXCLUSIVE option such as
Code:
USE MyTable IN 0 ALIAS MyDBF [B]EXCLUSIVE[/B]

In that way you can ensure that when one user is USE'ing a data table, they are doing so in a non-exclusive manner which will allow others to use it as well.

Lastly look for the use of FLOCK and/or RLOCK commands which might be locking things. Best to either not use those commands - relying instead on VFP's inherent record locking, or limit use of them.

Good Luck,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top