In vesp_SessionBegin. Added a command to delete Owners where the SessionID is not in the Sessions table. This fixes an issue that happens when PROMS is abnormally terminated and not allowed to clean up before exiting.

This commit is contained in:
John Jenko 2015-01-08 21:07:24 +00:00
parent 9ce6c8c2b5
commit ace837aa1d

View File

@ -7448,6 +7448,7 @@ BEGIN TRY -- Try Block
--delete inactive sessions where last activity is before 15 minutes ago
DELETE FROM Sessions WHERE UserID = @UserID and DTSEnd is null and DTSActivity < DATEADD(minute, -5, getdate())
DELETE FROM Sessions WHERE DTSEnd is null and DTSActivity < DATEADD(minute, -15, getdate())
DELETE FROM Owners WHERE SessionID not in (SELECT SessionID FROM Sessions)
INSERT INTO [Sessions]([UserID],[MachineName],[ProcessID])
VALUES (@UserID, @MachineName, @ProcessID)
SELECT