/** * Create a session for the given user. * * @param user the user * @return the session * @throws DbException if the database is in exclusive mode */ public synchronized Session createSession(User user) { Session session = new Session(this, user, ++nextSessionId); userSessions.add(session); if (trace.isDebugEnabled()) { trace.debug("create session id[{0}]", session.getId(), "engine"); } return session; }