org.neo4j.kernel
Interface TransactionBuilder


public interface TransactionBuilder

A builder for controlling certain behaviors of a transaction. Methods that return TransactionBuilder returns a new instance with the updated configuration that the method call modified. When the behavior is as desired a call to begin() will begin the transaction and return a Transaction.

 // To begin a transaction with default behavior
 Transaction tx = graphDb.tx().begin();
 
 // To begin a transaction with relaxed force
 Transaction tx = graphDb.tx().relaxed().begin();
 
 // To have relaxed force optionally set by a condition
 TransactionBuilder txBuilder = graphDb.tx();
 if ( condition )
 {
     txBuilder = txBuilder.relaxed();
 }
 Transaction tx = txBuilder.begin();
 

Author:
Mattias Persson

Method Summary
 Transaction begin()
          Starts a new transaction and associates it with the current thread.
 TransactionBuilder unforced()
          Relaxes the forcing constraint of the logical logs for this transaction so that the data is written out, but not forced to disk.
 

Method Detail

begin

Transaction begin()
Starts a new transaction and associates it with the current thread.

Returns:
a new transaction instance

unforced

TransactionBuilder unforced()
Relaxes the forcing constraint of the logical logs for this transaction so that the data is written out, but not forced to disk. Pros Cons

Returns:
a TransactionBuilder instance with relaxed force set.


Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.