Distributed Transactions from the Kotlin SDK

  • how-to
    +
    Distributed ACID Transactions with JVM SDKs

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

    Java Transactions from the Kotlin SDK

    You will need to include the Couchbase Java SDK in your project.

    Create a com.couchbase.client.java.Cluster in your Kotlin 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.kotlin.Cluster, which are independent connections.

    Additional Information

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