Class JdbcExactlyOnceOptions.JDBCExactlyOnceOptionsBuilder

  • Enclosing class:
    JdbcExactlyOnceOptions

    @PublicEvolving
    public static class JdbcExactlyOnceOptions.JDBCExactlyOnceOptionsBuilder
    extends Object
    JDBCExactlyOnceOptionsBuilder.
    • Constructor Detail

      • JDBCExactlyOnceOptionsBuilder

        public JDBCExactlyOnceOptionsBuilder()
    • Method Detail

      • withRecoveredAndRollback

        public JdbcExactlyOnceOptions.JDBCExactlyOnceOptionsBuilder withRecoveredAndRollback​(boolean recoveredAndRollback)
        Toggle discovery and rollback of prepared transactions upon recovery to prevent new transactions from being blocked by the older ones. Each subtask rollbacks its own transaction. This flag must be disabled when rescaling to prevent data loss.
      • withTransactionPerConnection

        public JdbcExactlyOnceOptions.JDBCExactlyOnceOptionsBuilder withTransactionPerConnection​(boolean transactionPerConnection)
        Set whether the same connection can be used for multiple XA transactions. A transaction is prepared each time a checkpoint is performed; it is committed once the checkpoint is confirmed. There can be multiple un-confirmed checkpoints and therefore multiple prepared transactions.

        Some databases support this natively (e.g. Oracle); while others only allow a single XA transaction per connection (e.g. MySQL, PostgreSQL).

        If enabled, each transaction uses a separate connection from a pool. The database limit of open connections might need to be adjusted.

        Disabled by default.