private void cleanConnection(boolean doForceEndTransactions) {

        final ThrowableSuppressor throwableSuppressor = new ThrowableSuppressor();

        boolean wasInTransaction = false;

        if (doForceEndTransactions) {
            wasInTransaction = throwableSuppressor.suppressAppend(
                    // if the connection was not closed, check whether it is in a transaction
                    // if any of this throws an exception, assume that the connection was closed,
                    // skip the transaction check and record the exception
                    () -> !connection.isClosed() && isInTransaction(),
                    false);
        }

        if (wasInTransaction) {
            throwableSuppressor.suppressAppend(this::rollback);
        }

        try {
            connectionCleaner.close();
        } catch (SQLException e) {
            CloseException ce = new CloseException("Unable to close Connection", e);
            throwableSuppressor.attachToThrowable(ce);
            throw ce;
        }

        throwableSuppressor.throwIfNecessary(t -> new CloseException("Failed to clear transaction status on close", t));

        if (wasInTransaction) {
            throw new TransactionException("Improper transaction handling detected: A Handle with an open "
                    + "transaction was closed. Transactions must be explicitly committed or rolled back "
                    + "before closing the Handle. "
                    + "Jdbi has rolled back this transaction automatically."
                    + "This check may be disabled by calling getConfig(Handles.class).setForceEndTransactions(false).");
        }
    }
Returns the extension method currently bound to the handle's context.

@return the extension method currently bound to the handle's context
core/src/main/java/org/jdbi/v3/core/Handle.java