class TransactionProxy extends AbstractDOMStoreTransaction<TransactionIdentifier> implements DOMStoreReadWriteTransaction {

    @Override
    public final void close() {
        if (!seal(TransactionState.CLOSED)) {
            checkState(state == TransactionState.CLOSED, "Transaction %s is ready, it cannot be closed",
                getIdentifier());
            // Idempotent no-op as per AutoCloseable recommendation
            return;
        }

        for (TransactionContextWrapper contextWrapper : txContextWrappers.values()) {
            contextWrapper.maybeExecuteTransactionOperation(new TransactionOperation() {
                @Override
                public void invoke(final TransactionContext transactionContext, final Boolean havePermit) {
                    transactionContext.closeTransaction();
                }
            });
        }


        txContextWrappers.clear();
    }

    @VisibleForTesting public  TransactionProxy(final AbstractTransactionContextFactory<?> txContextFactory, final TransactionType type);

}