Hi I have an occasional issue which is puzzling me: We have an application that writes to file (camera recording data), stores the filepaths in a SQL table and changes the files and folders fairly frequently, when this happens it updates a SQL tables.
I am writing a separate service to monitor that the system does indeed write to file regularly. This queries the system for the cameras and their current file paths, then periodically checks the modified timestamp on the file. When this is older than now - a threshold we raise an alarm.
The issue: occasionally my code detects the file has not been written to - it then checks the database to see that the file has not been changed - (the monitored system will update the file tables) I get the old file paths back. So using the VC 2005 C++ debugger I break at this point in my code and go back and rerun the query ... then I get the new paths.??? So I tried on the first detection of no write - to set an entry in map to and recheck on the next polling cycle (8 seconds later in the test case) quite often this too fails. But if then step through with the debugger - re run the query - and It returns the new file path! Aghhh!!!
Is there a way I can force SQL Server to flush any internal caches perhaps? Any thoughts would be very much appreciated!
Doubt if it's sql server. Try using the profiler to see if the query is being run on the database. I suspect there is something which caches the data for a time and you need to change it to refresh on every query.
========================================== Cursors are useful if you don't know sql. SSIS can be used in a similar way. Beer is not cold and it isn't fizzy.
Yes reckon so. I see you are a CAMRA man! Ideal! I need to figure out where the details are being cached and a way to clean the cache. We have no SLA on the server code doing its thing with in a defined time frame.