private void writeAllRows() { session.getId(); throw DbException.getUnsupportedException("TODO"); }
/** * 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; }
/** * Close the database. */ public synchronized void close() { if (closing) { return; } if (userSessions.size() > 0) { Session[] all = new Session[userSessions.size()]; userSessions.toArray(all); for (Session s : all) { try { s.rollback(); s.close(); } catch (DbException e) { trace.error(e, "disconnecting session #{0}", s.getId()); } } } repository.close(); if (queryExecutor != null) { Threads.shutdownGracefully(queryExecutor, 1000, 1000, TimeUnit.MILLISECONDS); } closing = true; }
private static boolean cancelStatement(Session session, int targetSessionId) { session.getUser().checkAdmin(); Session[] sessions = session.getDatabase().getSessions(); for (Session s : sessions) { if (s.getId() == targetSessionId) { Command c = s.getCurrentCommand(); if (c == null) { return false; } c.cancel(); return true; } } return false; }
"" + s.getId(),
break; case SESSION_ID: result = ValueInt.get(session.getId()); break; case IFNULL: {