Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Network changes slow to be picked up
Message
From
14/04/2011 11:53:59
 
 
To
13/04/2011 20:13:32
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01507134
Message ID:
01507333
Views:
75
Hi Al,

I turned off the write-caching last night - at first, it seemed to make some difference but then other tests were not so conclusive.

Before I get into changing the code, some questions:

1) FLOCK() - does this really force VFP to get the latest data? have you found that? I assumed it was just for operations that updated a bunch or all the records? i.e. will it really give me the latest data?

2) the SQL statement is really fast so setting the lock, running the query and releasing it should not be a problem - but what does that mean for users submitting records to be processed? these are submitted via two views and TableUpdate() (multiple records each typically so that's why it was easier in a view instead of inserting the records). If these are submitted via tableupdate(), I assume it would fail if the table was locked; would I have to put the tableupdate() within a loop and keep trying until successful?

Albert

>>Hi all,
>>
>>I have an app that sits on 2 servers and "polls" a table for records newly added to a table (these records then form the basis for a report). The app checks every 3 seconds by doing a SQL select against the table (to make it easy to order the reports by "submit time" which is stamped on the record as they are submitted).
>>
>>The problem is that it sometimes takes from 15 to 30 seconds for the polling app to pick up these records - there is a big lag between when the user submits the records via their desktop app and when the SQL statement actually returns some records to be processed.
>>
>>Secondly, sometimes a record is picked up by the SQL statement as one to be printed and then when it prints, it is missing some of the memo field data on the report - as if VFP still does not "see" all the data for this record.
>>
>>Any ideas?
>
>Before messing around with disabling disk write caching and/or SMB2, you need to make sure your polling routine is issuing FLOCK() on the tables it's SELECTing from before doing the SELECT(s). Getting an FLOCK() is the only way you're guaranteed to get current data.
>
>FLOCK() causes contention, so one idea is to release it just after you successfully get it, then do your SELECT. Or, if the SELECT doesn't take long, leave the lock in place, and release it when you're done.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform