import com.arangodb.*; import com.arangodb.entity.*; import com.arangodb.util.*; public class TransactionExample { public static void main(String[] args) { ArangoDB arangoDB = new ArangoDB.Builder().build(); try { db.transaction( new TransactionOptions().allowImplicit(false), new TransactionCallback<Boolean>() { public Boolean execute(Transaction transaction) throws ArangoDBException { DocumentCreateEntity<Entity> result = db.collection("mycollection").insertDocument(new Entity("key", "value")); System.out.println(result.getKey()); return true; } } ); } catch (ArangoDBException e) { e.printStackTrace(); } arangoDB.shutdown(); } } [database] disable-transaction-sync = false


上一篇:
下一篇:
切换中文