// [#3234] Defer initialising of a connection until the prepare step
// This optimises unnecessary ConnectionProvider.acquire() calls when
// ControlFlowSignals are thrown
if (ctx.connection() == null) {
throw new DetachedException("Cannot execute query. No Connection configured");
}
listener.prepareStart(ctx);
prepare(ctx);
listener.prepareEnd(ctx);