@Test public void transactionPerEventShouldCloseConnection() throws Exception { Connection c = mock(Connection.class); ConnectionPool.of(c) .execute(connection -> just(null, null)) .withTransactionPerEvent() .toBlocking().subscribe(o -> {}, throwable -> {}); verify(c, times(1)).close(); }
public TransactionContextExecutor<T> withTransactionPerEvent() { return new TransactionContextExecutor<>(TRANSACTION_PER_EVENT_TRANSACTION_CONTEXT, provider, connectionConsumer); }
TransactionContextExecutor extends Observable<T> { public TransactionContextExecutor<T> withTransactionPerEvent() { return new TransactionContextExecutor<>(TRANSACTION_PER_EVENT_TRANSACTION_CONTEXT, provider, connectionConsumer); } }
TransactionContextExecutor extends Observable<T> { public TransactionContextExecutor<T> withTransactionPerEvent() { return new TransactionContextExecutor<>(TRANSACTION_PER_EVENT_TRANSACTION_CONTEXT, provider, connectionConsumer); } TransactionContextExecutor(
    TransactionContext transactionContext,
    ConnectionProvider provider,
    ConnectionConsumer<T> connectionConsumer
  ); }
TransactionContextExecutor extends Observable<T> { public TransactionContextExecutor<T> withTransactionPerEvent() { return new TransactionContextExecutor<>(TRANSACTION_PER_EVENT_TRANSACTION_CONTEXT, provider, connectionConsumer); } TransactionContextExecutor(
    TransactionContext transactionContext,
    ConnectionProvider provider,
    ConnectionConsumer<T> connectionConsumer
  ); TransactionContextExecutor<T> withAutoCommit(); TransactionContextExecutor<T> withSingleTransaction(); TransactionContextExecutor<T> withTransactionPerEvent(); }
TransactionContextExecutor extends Observable<T> { public TransactionContextExecutor<T> withTransactionPerEvent() { return new TransactionContextExecutor<>(TRANSACTION_PER_EVENT_TRANSACTION_CONTEXT, provider, connectionConsumer); } TransactionContextExecutor(
    TransactionContext transactionContext,
    ConnectionProvider provider,
    ConnectionConsumer<T> connectionConsumer
  ); TransactionContextExecutor<T> withAutoCommit(); TransactionContextExecutor<T> withSingleTransaction(); TransactionContextExecutor<T> withTransactionPerEvent(); static final AutoCommitTransactionContext AUTO_COMMIT_TRANSACTION_CONTEXT; static final SingleTransactionTransactionContext SINGLE_TRANSACTION_TRANSACTION_CONTEXT; static final TransactionPerEventTransactionContext TRANSACTION_PER_EVENT_TRANSACTION_CONTEXT; }