Package net.carcdr.ycrdt.jni
Class JniYTransaction
java.lang.Object
net.carcdr.ycrdt.jni.JniYTransaction
- All Implemented Interfaces:
AutoCloseable,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
-
Method Summary
-
Method Details
-
commit
public void commit()- Specified by:
commitin interfacenet.carcdr.ycrdt.YTransaction
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfacenet.carcdr.ycrdt.YTransaction
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfacenet.carcdr.ycrdt.YTransaction
-