sessionPassword = null;
return registerSesion(colEntity, isSuperUser);
}
protected int registerSesion(CollaboratorAbstract colEntity, boolean isSuperUser) throws ClipsServerException{
CollaboratorSessionActive ses;
Throwable ex = null;
Random rnd = new Random();
int sd = 0, newSessionId = 0, i = 0;
//@todo иногда 10 не хватает
while (newSessionId == 0 && i < ClipsServerConstants.MAX_LOGIN_ATTEMPT_COUNT) {
do {
sd = rnd.nextInt(Integer.MAX_VALUE) + 1;
ses = manager.find(CollaboratorSessionActive.class, sd);
} while (ses != null);
ses = new CollaboratorSessionActive();
ses.setSessionId(sd);
ses.setCollaborator(colEntity);
ses.setLastCallMoment(new Date());
ses.setAdmin(isSuperUser);
ses.incRefCount();
try {
manager.persist(ses);
manager.flush();
newSessionId = sd;
} catch (Throwable e) {