java.lang.Object
org.neo4j.driver.TransactionConfig.Builder
- Enclosing class:
- TransactionConfig
Builder used to construct
transaction configuration objects.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the transaction configuration object using the specified settings.Set the transaction timeout to the server-side configured default timeout.withMetadata(Map<String, Object> metadata) Set the transaction metadata.withTimeout(Duration timeout) Set the transaction timeout.
-
Method Details
-
withTimeout
Set the transaction timeout. Transactions that execute longer than the configured timeout will be terminated by the database. See alsowithDefaultTimeout().This functionality allows to limit query/transaction execution time. Specified timeout overrides the default timeout configured in the database using
dbms.transaction.timeoutsetting.Provided value should not represent a negative duration.
- Parameters:
timeout- the timeout.- Returns:
- this builder.
-
withDefaultTimeout
Set the transaction timeout to the server-side configured default timeout. This is the default behaviour ifwithTimeout(java.time.Duration)has not been called. See alsowithTimeout(java.time.Duration).- Returns:
- this builder.
-
withMetadata
Set the transaction metadata. Specified metadata will be attached to the executing transaction and visible in the output ofdbms.listQueriesanddbms.listTransactionsprocedures. It will also get logged to thequery.log.This functionality makes it easier to tag transactions and is equivalent to
dbms.setTXMetaDataprocedure.Provided value should not be
null.- Parameters:
metadata- the metadata.- Returns:
- this builder.
-
build
Build the transaction configuration object using the specified settings.- Returns:
- new transaction configuration object.
-