class BackendConnection implements JDBCExecutionConnection {

    public synchronized Collection<SQLException> closeConnections(final boolean forceRollback) {
        Collection<SQLException> result = new LinkedList<>();
        for (Connection each : cachedConnections.values()) {
            try {
                if (forceRollback && transactionStatus.isInTransaction()) {
                    each.rollback();
                }
                each.close();
            } catch (final SQLException ex) {
                result.add(ex);
            }
        }
        cachedConnections.clear();
        methodInvocations.clear();
        connectionStatus.switchToReleased();
        return result;
    }

    public  BackendConnection(final TransactionType initialTransactionType);

}