We have a customer licensed for just 4 users, 2 NAS's and 2 clients running SQL 2009R2. They wanted a session kill on a user for 30 miniutes of inactivity. I added some code (see below) to one of the NAS's that we use at other customers running versions 5.1 and 4.3. Code works great. Had an interesting side effect on 2009R2 SQL. After 30 minutes the Session record is deleted if the client was inactive. If 2 users were idle then both session records are deleted allowing another client to connect. The 2 idle sessions appear to the user to be active. When they touch their screen the session record is restablished with no apparent interruption. If both knocked off users touch their screen they are connected. We now have 5 active users (2 NAS and 3 Cleints) while the license clearly only allows 4. If one of the clients logs off they cannot get back in, they get the standard number of sessions exceeded. It seems like a huge license loop hole. If the session records are deleted through the NAS it allows other users to log on but then allows the active clients (whose sessons records were deleted) to re-establish another session record exceeding the license limit.
session.SETRANGE("My Session",FALSE);
session.SETFILTER(session."Application Name",'%1','Microsoft Dynamics NAV Classic client');
session.SETFILTER(session."Database Name",'%1','ECPNavision');
session.SETFILTER("Idle Time",'>30 min');
IF session.FIND('-') THEN BEGIN
session.DELETE;
MESSAGE('UserID %1 logged off for IDLE time', session."User ID"); // goes to event viewer
COMMIT;
END;
0
Comments
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Works fine with version 5.1