Как насчет контроля за количеством сессий? Т.е. не открывать новые сессии, если не закрыты старые?
В АХ4 этого можно добиться, прописав следующий код в начале метода
AppComponent.handleStartupEvent()
X++:
#define.SessionsAllowed(3)
SysClientSessions clientSessions;
;
select count(RecId) from clientSessions
where clientSessions.UserId == curuserid()
&& clientSessions.Status == 1
&& clientSessions.ClientType == 0;
if (clientSessions.RecId > #SessionsAllowed)
{
box::stop(strfmt("%1 is only allwed %2 AX Client Sessions. AX Client will close now.",
xUserInfo::find().name, #SessionsAllowed), "AX Client Sessions exceeded");
appl.globalCache().set(classstr(Info),identifierstr(Autologoff), true);
info = new Info();
info.shutDown(true);
}
Мы даже сделали таблицу с 2 полями: UserId, AllowedSessions.
Разработчикам и консам дали 5 сессий, а остальным по 3. Все довольны.