Class AbstractTransaction

    • Constructor Detail

      • AbstractTransaction

        public AbstractTransaction​(Graph graph)
    • Method Detail

      • doOpen

        protected abstract void doOpen()
        Called within open() if it is determined that the transaction is not yet open given Transaction.isOpen(). Implementers should assume the transaction is not yet started and should thus open one.
      • doReadWrite

        protected abstract void doReadWrite()
        Called readWrite(). Implementers should run their readWrite consumer here.
      • doClose

        protected abstract void doClose()
        Called close(). Implementers should run their readWrite consumer here.
      • open

        public void open()
        Opens a transaction.
        Specified by:
        open in interface Transaction
      • commit

        public void commit()
        Commits a transaction. This method may optionally throw TransactionException on 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:
        commit in interface Transaction
      • rollback

        public void rollback()
        Rolls back a transaction. This method may optionally throw TransactionException on 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:
        rollback in interface Transaction
      • createThreadedTx

        public <G extends Graph> G createThreadedTx()
        Creates a transaction that can be executed across multiple threads. The Graph returned from this method is not meant to represent some form of child transaction that can be committed from this object. A threaded transaction is a Graph instance that has a transaction context that enables multiple threads to collaborate on the same transaction. A standard transactional context tied to a Graph that supports transactions will typically bind a transaction to a single thread via ThreadLocal.
        Specified by:
        createThreadedTx in interface Transaction
      • begin

        public <T extends TraversalSource> T begin​(Class<T> traversalSourceClass)
        Description copied from interface: Transaction
        Starts a transaction in the context of a particular TraversalSource instance. It is up to the Transaction implementation to decide what this means and up to users to be aware of that meaning.
        Specified by:
        begin in interface Transaction
      • readWrite

        public void readWrite()
        An internal function that signals a read or a write has occurred - not meant to be called directly by end users.
        Specified by:
        readWrite in interface Transaction