/** * Check if this statement was canceled. * * @throws DbException if it was canceled */ public void checkCanceled() { session.checkCanceled(); Command c = command != null ? command : session.getCurrentCommand(); if (c != null) { c.checkCanceled(); } }
for (Session s : database.getSessions()) { if (admin || s == session) { Command command = s.getCurrentCommand(); long start = s.getCurrentCommandStart(); if (start == 0) {
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; }