protected final void prepare(Session s) { if (isPrepared) { return; } this.session = s; this.database = session.getDatabase(); this.queryExecutor = database.getQueryExecutor(); this.routingHandler = database.getRoutingHandler(); this.queryHandlerFactory = session.getQueryHandlerFactory(); doPrepare(); isPrepared = true; }