public static Handle getHandle(Jdbi jdbi) {
        Handle bound = (Handle) TransactionSynchronizationManager.getResource(jdbi);
        if (bound == null) {
            bound = jdbi.open();
            if (TransactionSynchronizationManager.isSynchronizationActive()) {
                TransactionSynchronizationManager.bindResource(jdbi, bound);
                TransactionSynchronizationManager.registerSynchronization(new Adapter(jdbi, bound));
                TRANSACTIONAL_HANDLES.add(bound);
            }
        }
        return bound;
    }
Obtain a Handle instance, either the transactionally bound one if we are in a transaction,
or a new one otherwise.
@param jdbi the Jdbi instance from which to obtain the handle

@return the Handle instance
spring5/src/main/java/org/jdbi/v3/spring5/JdbiUtil.java