My customer had requested a customization which will auto log off a Navision Idle session if number of user sessions is exceeded from the license allowed. This customization is done on NAV2009 sql server option. I had tried on using a SQL automation ('Microsoft SQLDMO Object Library'.SQLServer) to kill the process from SQL server since deletion of record on Navision Session table is not working. Below is my part of coding on using the automation to kill the process:
IF NOT ISCLEAR(autoSQL) THEN
I was placed these code in Codeunit 1 ApplicationManagement, and trigger on LogInStart() function. Which I thinking to check session table for the idle session and kill it while login as a new session. The problem is my coding getting a run time error which shown below and the session is not killed.
The following SQL Server error or errors occurred:
6104,"42000",[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot use KILL to kill your own process.
Can anyone advice me on this my idea? Or any suggestion on this auto log off customization?