- Java
-
A transaction is performed by calling
.submitTx
on anIXtdbSubmitAPI
with aTransaction
object.The
Transaction
object can be created by either usingTransaction.Builder
directly or using aConsumer
.If using the
Consumer
approach, we recommend importingxtdb.api.tx.Transaction.buildTx
statically for brevity.link:example$test/xtdb/docs/examples/transactions/TransactionsTest.java[role=include] link:example$test/xtdb/docs/examples/transactions/TransactionsTest.java[role=include] link:example$test/xtdb/docs/examples/transactions/TransactionsTest.java[role=include] // To run the transaction: link:example$test/xtdb/docs/examples/transactions/TransactionsTest.java[role=include] // To run a transaction directly: link:example$test/xtdb/docs/examples/transactions/TransactionsTest.java[role=include]
- Clojure
-
A transaction is performed by calling
xtdb.api/submit-tx
on a node with a list of transaction operations.(xt/submit-tx node [ ;; Operations ])