Class JniYTransaction

java.lang.Object
net.carcdr.ycrdt.jni.JniYTransaction
All Implemented Interfaces:
AutoCloseable, net.carcdr.ycrdt.YTransaction

public class JniYTransaction extends Object implements net.carcdr.ycrdt.YTransaction
JNI-based implementation of YTransaction.

Transactions allow multiple operations to be combined into a single atomic unit, resulting in:

  • Better performance (fewer JNI calls, single commit)
  • Single observer notification with combined changes
  • More efficient update encoding for synchronization

Usage with try-with-resources (recommended):


 try (YTransaction txn = doc.beginTransaction()) {
     text.insert(txn, 0, "Hello");
     text.insert(txn, 5, " World");
 } // Auto-commits here