Class DriverRemoteTransaction
- java.lang.Object
- 
- org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteTransaction
 
- 
- All Implemented Interfaces:
- AutoCloseable,- RemoteConnection,- Transaction
 
 public class DriverRemoteTransaction extends Object implements Transaction, RemoteConnection A remoteTransactionimplementation that is implemented with the Java driver. It is also a proxy for aRemoteConnectionthat is bound to a session. For users, starting a transaction withTransaction.begin()will produce aTraversalSourcethat can be used across multiple threads sending the bytecode based requests to a remote session. It is worth noting that the session will process these requests in a serial fashion and not in parallel. Callingcommit()orrollback()will also close the session and no additional traversal can be executed on theTraversalSource. A fresh call toTransaction.begin()will be required to open a fresh session to work with. The default behavior ofclose()is to commit the transaction.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.structure.TransactionTransaction.CLOSE_BEHAVIOR, Transaction.Exceptions, Transaction.READ_WRITE_BEHAVIOR, Transaction.Status
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected Consumer<Transaction>closeConsumer- 
Fields inherited from interface org.apache.tinkerpop.gremlin.process.remote.RemoteConnectionGREMLIN_REMOTE, GREMLIN_REMOTE_CONNECTION_CLASS
 - 
Fields inherited from interface org.apache.tinkerpop.gremlin.structure.TransactionNO_OP
 
- 
 - 
Constructor SummaryConstructors Constructor Description DriverRemoteTransaction(DriverRemoteConnection sessionBasedConnection)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTransactionListener(Consumer<Transaction.Status> listener)There is no support for remote transaction listeners.<T extends TraversalSource>
 Tbegin(Class<T> traversalSourceClass)Starts a transaction in the context of a particularTraversalSourceinstance.voidclearTransactionListeners()There is no support for remote transaction listeners.voidclose()The default close behavior for thisTransactionimplementation is tocommit().voidcommit()Commits a transaction.booleanisOpen()Determines if a transaction is currently open.TransactiononClose(Consumer<Transaction> consumer)Describes what happens to a transaction on a call toGraph.close().TransactiononReadWrite(Consumer<Transaction> consumer)ThisTransactionimplementation is not auto-managed and therefore this method is not supported.voidopen()By virtue of creating aDriverRemoteTransaction, the transaction is considered open.voidreadWrite()ThisTransactionimplementation is not auto-managed and therefore this method is not supported.voidremoveTransactionListener(Consumer<Transaction.Status> listener)There is no support for remote transaction listeners.voidrollback()Rolls back a transaction.<E> CompletableFuture<RemoteTraversal<?,E>>submitAsync(Bytecode bytecode)Transactiontx()It is not possible to have child transactions, therefore this method always returnsTransaction.NO_OP.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.tinkerpop.gremlin.structure.Transactionbegin, createThreadedTx
 
- 
 
- 
- 
- 
Field Detail- 
closeConsumerprotected Consumer<Transaction> closeConsumer 
 
- 
 - 
Constructor Detail- 
DriverRemoteTransactionpublic DriverRemoteTransaction(DriverRemoteConnection sessionBasedConnection) 
 
- 
 - 
Method Detail- 
beginpublic <T extends TraversalSource> T begin(Class<T> traversalSourceClass) Description copied from interface:TransactionStarts a transaction in the context of a particularTraversalSourceinstance. It is up to theTransactionimplementation to decide what this means and up to users to be aware of that meaning.- Specified by:
- beginin interface- Transaction
 
 - 
openpublic void open() By virtue of creating aDriverRemoteTransaction, the transaction is considered open. There is no need to call this method. Calling it when the transaction is closed will result in exception.- Specified by:
- openin interface- Transaction
 
 - 
commitpublic void commit() Description copied from interface:TransactionCommits a transaction. This method may optionally throwTransactionExceptionon error. Providers should consider wrapping their transaction exceptions in this TinkerPop exception as it will lead to better error handling with Gremlin Server and other parts of the stack.- Specified by:
- commitin interface- Transaction
 
 - 
rollbackpublic void rollback() Description copied from interface:TransactionRolls back a transaction. This method may optionally throwTransactionExceptionon error. Providers should consider wrapping their transaction exceptions in this TinkerPop exception as it will lead to better error handling with Gremlin Server and other parts of the stack.- Specified by:
- rollbackin interface- Transaction
 
 - 
isOpenpublic boolean isOpen() Description copied from interface:TransactionDetermines if a transaction is currently open.- Specified by:
- isOpenin interface- Transaction
 
 - 
closepublic void close() The default close behavior for thisTransactionimplementation is tocommit().- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Transaction
 
 - 
readWritepublic void readWrite() ThisTransactionimplementation is not auto-managed and therefore this method is not supported.- Specified by:
- readWritein interface- Transaction
 
 - 
onReadWritepublic Transaction onReadWrite(Consumer<Transaction> consumer) ThisTransactionimplementation is not auto-managed and therefore this method is not supported.- Specified by:
- onReadWritein interface- Transaction
 
 - 
onClosepublic Transaction onClose(Consumer<Transaction> consumer) Description copied from interface:TransactionDescribes what happens to a transaction on a call toGraph.close(). This value can be set using standard behavior defined inTransaction.CLOSE_BEHAVIORor a mapperConsumerfunction.- Specified by:
- onClosein interface- Transaction
 
 - 
addTransactionListenerpublic void addTransactionListener(Consumer<Transaction.Status> listener) There is no support for remote transaction listeners.- Specified by:
- addTransactionListenerin interface- Transaction
 
 - 
removeTransactionListenerpublic void removeTransactionListener(Consumer<Transaction.Status> listener) There is no support for remote transaction listeners.- Specified by:
- removeTransactionListenerin interface- Transaction
 
 - 
clearTransactionListenerspublic void clearTransactionListeners() There is no support for remote transaction listeners.- Specified by:
- clearTransactionListenersin interface- Transaction
 
 - 
txpublic Transaction tx() It is not possible to have child transactions, therefore this method always returnsTransaction.NO_OP.- Specified by:
- txin interface- RemoteConnection
 
 - 
submitAsyncpublic <E> CompletableFuture<RemoteTraversal<?,E>> submitAsync(Bytecode bytecode) throws RemoteConnectionException Description copied from interface:RemoteConnectionSubmitsTraversalBytecodeto a server and returns a promise of aRemoteTraversal. TheRemoteTraversalis an abstraction over two types of results that can be returned as part of the response from the server: the results of theTraversalitself and the side-effects that it produced.- Specified by:
- submitAsyncin interface- RemoteConnection
- Throws:
- RemoteConnectionException
 
 
- 
 
-