Look at online users (System Administrator > Users > Online Users), where you may see a user with status “Ending – Blocked”. This is because AX locked the user session when there was a problem to complete processing a transaction - maybe due to time or a deadlock.
On the User Online screen see which userID and which session has status as Ending –Block
Go to the SQL server, look into SYSCLIENTSESSIONS table to see all user sessions.
SELECT TOP (200) SESSIONID, SERVERID, VERSION, LOGINDATETIME, LOGINDATETIMETZID, STATUS, USERID, SID, USERLANGUAGE, HELPLANGUAGE,
CLIENTTYPE, SESSIONTYPE, CLIENTCOMPUTER, DATAPARTITION, RECVERSION, RECID
FROM SYSCLIENTSESSIONS
WHERE (USERID = ‘Admin’)
Delete the line with the USERID and SESSIONID of that user
You may find many sessions with both inactive and blocked status.
These inactive and block session are often due to crashing of AX clients or just forgetting to log off.
These sessions may not create any problem.
However, when youy start the AOS service with many blocked or inactive sessions then, it may take too much time for the system to change status from Starting to Started. One reason for this is that AX will try to query and locate any Active session in SysClientSessions.
To reduce that time remove all session inactive from SysClientSessions table In “SysClientSessions” Status with:
Status 0 (Inactive),
Status 2 (Ending Waiting for AOS),
Status 3 (Ending –Block).
1. Stop AOS service.
2. Open SQL Server Management Studio
3. Open a new query on Dynamics Ax Database.
4. Run the following Query
where sessions with status 0 (Inactive), Status 2 (Ending Waiting for AOS), 3 (Ending –Block).
delete from SysClientSessions where status in(0,2,3)
5. Restart AOS.