DatabaseCloser(Database db, int delayInMillis, boolean shutdownHook) { this.databaseRef = new WeakReference<Database>(db); this.delayInMillis = delayInMillis; this.shutdownHook = shutdownHook; trace = db.getTrace(Trace.DATABASE); }
public StatementWrapper(ServerSession session, StatementBase statement) { super(session); this.statement = statement; trace = session.getDatabase().getTrace(Trace.COMMAND); }
/** * Initialize some attributes of this object. * * @param db the database * @param id the object id * @param name the object name * @param traceModuleId the trace module id */ protected DbObjectBase(Database database, int id, String name, int traceModuleId) { this.database = database; this.id = id; this.name = name; this.trace = database.getTrace(traceModuleId); this.modificationId = database.getModificationMetaId(); }
/** * Execute the meta data statement. * * @param db the database * @param systemSession the system session * @param listener the database event listener */ public void execute(Database db, ServerSession systemSession, DatabaseEventListener listener) { try { PreparedStatement command = systemSession.prepareStatementLocal(sql); command.setObjectId(id); command.executeUpdate(); } catch (DbException e) { e = e.addSQL(sql); SQLException s = e.getSQLException(); db.getTrace(Trace.DATABASE).error(s, sql); if (listener != null) { listener.exceptionThrown(s, sql); // continue startup in this case } else { throw e; } } }