
Package ca.uhn.fhir.jpa.util
Class TransactionSemanticsHeader.Builder
java.lang.Object
ca.uhn.fhir.jpa.util.TransactionSemanticsHeader.Builder
- Enclosing class:
TransactionSemanticsHeader
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Construct the headerwithMaxRetryDelay
(Integer theMaxRetryDelay) When automatically retrying a failed transaction, the system will first sleep for a minimum of this number of milliseconds.withMinRetryDelay
(Integer theMinRetryDelay) When automatically retrying a failed transaction, the system will first sleep for a minimum of this number of milliseconds.withRetryCount
(Integer theRetryCount) Specifies the number of retry attempts which should be attempted if the initial transaction processing fails with any kind of error.withTryBatchAsTransactionFirst
(boolean theTryBatchAsTransactionFirst) When processing a FHIR Batch bundle, try it as a FHIR transaction first, and only switch to batch mode on the first retry.
-
Method Details
-
withRetryCount
Specifies the number of retry attempts which should be attempted if the initial transaction processing fails with any kind of error. A value of 0 (or null means that the transaction will be attempted once only (i.e. the default behaviour). A value of 2 means that the transaction will be attempted once, and if it fails, up to two more attempts will be made before giving up. -
withMinRetryDelay
When automatically retrying a failed transaction, the system will first sleep for a minimum of this number of milliseconds. -
withMaxRetryDelay
When automatically retrying a failed transaction, the system will first sleep for a minimum of this number of milliseconds. -
withTryBatchAsTransactionFirst
public TransactionSemanticsHeader.Builder withTryBatchAsTransactionFirst(boolean theTryBatchAsTransactionFirst) When processing a FHIR Batch bundle, try it as a FHIR transaction first, and only switch to batch mode on the first retry. This option is useful in cases where data can safely be ingested as a FHIR Batch, since FHIR Transaction processing is generally significantly faster. However, FHIR transactions exhibit an all-or-nothing failure mode which is not always desirable for batch ingestion, so this option provides an easy fallback which brings the benefits of both approaches. -
build
Construct the header
-