I think much of my problem here is having initsession() in my OnProcessInit() - meaning it's getting called for every little JSON request whether it's needed or not. I'm wondering if I could reliably use oRequest.cphysicalPath() to reliably tell me whether the request has JSON in the name (I precede my JSON calls with that) and skip over InitSession in those cases. For those one or two JSON requests that do need session info, I can put it at the beginning of the function... Does that sound rational?
Hi Michael,
Code like the replace x with x is required to ensure that you see the latest value from other sessions. It's really a VFP issue to ensure that you're getting the latest data from a table/cursor that isn't cached by VFP. I know of no other way for VFP to forceably refresh its buffers short of running a really short SET REFRESH TO value which will bring your app to a crawl. This is important for async AJAX calls, iFrame/Frames content etc that might be happening in multiple sessions 'simultaneously'.
I run with SET REPROCESS TO 2 SECONDS and haven't seen any issues with that but I don't think that's the issue here. The issue is that you have many clients updating the session table simultaneously I'm guessing. It's pretty hard to make happen I'd think unless you have bunch of instances running possibly across several machines. How many instances?
The right solution for this might be to use SQL Server sessions instead of VFP for this...
+++ Rick ---
In wwSession.LocateSession we have:
Replace SessionId with SessionId
On a busy site (6 COM instances) I'm seeing a lot of "Record is in use by another user" errors in the error log and on screen. It's being hit by a call to 'IsValidSession'
There is some old code that may have set reprocess so I have bracketed that code to reset reprocess so I hope that resolves the issue.
Is there another way to force the refresh without locking the session record?
What should REPROCESS be set at to prevent contention?
Any other settings that might help?