public static class JdbcExactlyOnceOptions.JDBCExactlyOnceOptionsBuilder extends Object
Constructor and Description |
---|
JDBCExactlyOnceOptionsBuilder() |
Modifier and Type | Method and Description |
---|---|
JdbcExactlyOnceOptions |
build() |
JdbcExactlyOnceOptions.JDBCExactlyOnceOptionsBuilder |
withAllowOutOfOrderCommits(boolean allowOutOfOrderCommits)
Set whether transactions may be committed out-of-order in case of retries and this option
is enabled.
|
JdbcExactlyOnceOptions.JDBCExactlyOnceOptionsBuilder |
withMaxCommitAttempts(int maxCommitAttempts)
Set the number of attempt to commit a transaction (takes effect only if transient failure
happens).
|
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.
|
JdbcExactlyOnceOptions.JDBCExactlyOnceOptionsBuilder |
withTimeoutSec(Optional<Integer> timeoutSec)
Set transaction timeout in seconds (vendor-specific).
|
JdbcExactlyOnceOptions.JDBCExactlyOnceOptionsBuilder |
withTransactionPerConnection(boolean transactionPerConnection)
Set whether the same connection can be used for multiple XA transactions.
|
public JdbcExactlyOnceOptions.JDBCExactlyOnceOptionsBuilder withRecoveredAndRollback(boolean recoveredAndRollback)
public JdbcExactlyOnceOptions.JDBCExactlyOnceOptionsBuilder withMaxCommitAttempts(int maxCommitAttempts)
public JdbcExactlyOnceOptions.JDBCExactlyOnceOptionsBuilder withAllowOutOfOrderCommits(boolean allowOutOfOrderCommits)
public JdbcExactlyOnceOptions.JDBCExactlyOnceOptionsBuilder withTimeoutSec(Optional<Integer> timeoutSec)
public JdbcExactlyOnceOptions.JDBCExactlyOnceOptionsBuilder withTransactionPerConnection(boolean transactionPerConnection)
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.
public JdbcExactlyOnceOptions build()
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.