public interface Transaction
extends java.io.Closeable
Graph instance.| Modifier and Type | Interface and Description |
|---|---|
static class |
Transaction.CLOSE_BEHAVIOR
Behaviors to supply to the
onClose(java.util.function.Consumer). |
static class |
Transaction.Exceptions |
static class |
Transaction.READ_WRITE_BEHAVIOR
Behaviors to supply to the
onReadWrite(java.util.function.Consumer). |
static class |
Transaction.Workload<R>
A
Transaction.Workload represents a unit of work constructed by the
submit(java.util.function.Function) method on the Transaction interface. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the transaction where the default close behavior will be executed.
|
void |
commit()
Commits a transaction.
|
<G extends Graph> |
create()
Creates a transaction that can be executed across multiple threads.
|
boolean |
isOpen()
Determines if a transaction is currently open.
|
Transaction |
onClose(java.util.function.Consumer<Transaction> consumer)
Describes what happens to a transaction on a call to
AutoCloseable.close(). |
Transaction |
onReadWrite(java.util.function.Consumer<Transaction> consumer)
Describes how a transaction is started when a read or a write occurs.
|
void |
open()
Opens a transaction.
|
void |
readWrite()
An internal function that signals a read or a write has occurred - not meant to be called directly by end users.
|
void |
rollback()
Rolls back a transaction.
|
<R> Transaction.Workload<R> |
submit(java.util.function.Function<Graph,R> work)
Submit a unit of work that represents a transaction returning a
Transaction.Workload that can be automatically
retried in the event of failure. |
void open()
void commit()
void rollback()
<R> Transaction.Workload<R> submit(java.util.function.Function<Graph,R> work)
Transaction.Workload that can be automatically
retried in the event of failure.<G extends Graph> G create()
boolean isOpen()
void readWrite()
void close()
close in interface java.lang.AutoCloseableclose in interface java.io.CloseableTransaction onReadWrite(java.util.function.Consumer<Transaction> consumer)
Transaction.READ_WRITE_BEHAVIOR or a mapper Consumer function.Transaction onClose(java.util.function.Consumer<Transaction> consumer)
AutoCloseable.close().
This value can be set using standard behavior defined in Transaction.CLOSE_BEHAVIOR or a mapper Consumer
function.Copyright © 2013-2015 TinkerPop. All Rights Reserved.