A newer version of this documentation is available.

View Latest

Distributed Transactions from the Scala SDK

  • how-to
    +
    Distributed ACID Transactions with JVM SDKs

    Distributed ACID Transactions are implemented in the Java SDK, and simple to integrate into your Scala client code.

    Java Transactions from the Scala SDK

    Just create a com.couchbase.client.java.Cluster in your Scala app with the normal Java calls (Cluster.connect(…​)), and then do transactions on it as normal, e.g.:

    javaCluster.transactions().run(ctx => { /* your transaction logic here */ })

    So in your app you have both a com.couchbase.client.java.Cluster and a com.couchbase.client.scala.Cluster, which are independent connections.

    Additional Information

    For more information on Java transactions, read our guide in the Java documentation: