Class InternalReactiveTransaction

java.lang.Object
org.neo4j.driver.internal.reactive.AbstractReactiveTransaction
org.neo4j.driver.internal.reactivestreams.InternalReactiveTransaction
All Implemented Interfaces:
ReactiveQueryRunner, ReactiveTransaction

public class InternalReactiveTransaction extends AbstractReactiveTransaction implements ReactiveTransaction
  • Constructor Details

  • Method Details

    • run

      public org.reactivestreams.Publisher<ReactiveResult> run(Query query)
      Description copied from interface: ReactiveQueryRunner
      Register running of a query and return a publisher of ReactiveResult.

      Invoking this method will result in a Bolt RUN message exchange with server and the returned publisher will either emit an instance of ReactiveResult on success or an error otherwise.

      Specified by:
      run in interface ReactiveQueryRunner
      Parameters:
      query - a Neo4j query
      Returns:
      a publisher of reactive result.
    • terminate

      public org.reactivestreams.Publisher<Void> terminate()
      THIS IS A PRIVATE API

      Terminates the transaction by sending the Bolt RESET message and waiting for its response as long as the transaction has not already been terminated, is not closed or closing.

      Returns:
      completion publisher (the RESET completion publisher if the message was sent)
      Since:
      5.11
    • commit

      public <T> org.reactivestreams.Publisher<T> commit()
      Description copied from interface: ReactiveTransaction
      Commits the transaction. It completes without publishing anything if transaction is committed successfully. Otherwise, errors when there is any error to commit.
      Specified by:
      commit in interface ReactiveTransaction
      Type Parameters:
      T - makes it easier to be chained after other publishers.
      Returns:
      an empty publisher.
    • rollback

      public <T> org.reactivestreams.Publisher<T> rollback()
      Description copied from interface: ReactiveTransaction
      Rolls back the transaction. It completes without publishing anything if transaction is rolled back successfully. Otherwise, errors when there is any error to roll back.
      Specified by:
      rollback in interface ReactiveTransaction
      Type Parameters:
      T - makes it easier to be chained after other publishers.
      Returns:
      an empty publisher.
    • close

      public org.reactivestreams.Publisher<Void> close()
      Description copied from interface: ReactiveTransaction
      Close the transaction. If the transaction has been committed or rolled back, the close is optional and no operation is performed. Otherwise, the transaction will be rolled back by default by this method.
      Specified by:
      close in interface ReactiveTransaction
      Returns:
      new Publisher that gets completed when close is successful, otherwise an error is signalled.
    • isOpen

      public org.reactivestreams.Publisher<Boolean> isOpen()
      Description copied from interface: ReactiveTransaction
      Determine if transaction is open.
      Specified by:
      isOpen in interface ReactiveTransaction
      Returns:
      a publisher emitting true if transaction is open and false otherwise.
    • run

      default org.reactivestreams.Publisher<ReactiveResult> run(String queryStr, Value parameters)
      Description copied from interface: ReactiveQueryRunner
      Register running of a query and return a publisher of ReactiveResult.

      Invoking this method will result in a Bolt RUN message exchange with server and the returned publisher will either emit an instance of ReactiveResult on success or an error otherwise.

      This method takes a set of parameters that will be injected into the query by Neo4j. Using parameters is highly encouraged, it helps avoid dangerous cypher injection attacks and improves database performance as Neo4j can re-use query plans more often.

      This particular method takes a Value as its input. This is useful if you want to take a map-like value that you've gotten from a prior result and send it back as parameters.

      If you are creating parameters programmatically, ReactiveQueryRunner.run(String, Map) might be more helpful, it converts your map to a Value for you.

      Specified by:
      run in interface ReactiveQueryRunner
      Parameters:
      queryStr - text of a Neo4j query
      parameters - input parameters, should be a map Value, see Values.parameters(Object...).
      Returns:
      a publisher of reactive result.
    • run

      default org.reactivestreams.Publisher<ReactiveResult> run(String query, Map<String,Object> parameters)
      Description copied from interface: ReactiveQueryRunner
      Register running of a query and return a publisher of ReactiveResult.

      Invoking this method will result in a Bolt RUN message exchange with server and the returned publisher will either emit an instance of ReactiveResult on success or an error otherwise.

      This method takes a set of parameters that will be injected into the query by Neo4j. Using parameters is highly encouraged, it helps avoid dangerous cypher injection attacks and improves database performance as Neo4j can re-use query plans more often.

      This version of run takes a Map of parameters. The values in the map must be values that can be converted to Neo4j types. See Values.parameters(Object...) for a list of allowed types.

      Specified by:
      run in interface ReactiveQueryRunner
      Parameters:
      query - text of a Neo4j query
      parameters - input data for the query
      Returns:
      a publisher of reactive result.
    • run

      default org.reactivestreams.Publisher<ReactiveResult> run(String query, Record parameters)
      Description copied from interface: ReactiveQueryRunner
      Register running of a query and return a publisher of ReactiveResult.

      Invoking this method will result in a Bolt RUN message exchange with server and the returned publisher will either emit an instance of ReactiveResult on success or an error otherwise.

      This method takes a set of parameters that will be injected into the query by Neo4j. Using parameters is highly encouraged, it helps avoid dangerous cypher injection attacks and improves database performance as Neo4j can re-use query plans more often.

      This version of run takes a Record of parameters, which can be useful if you want to use the output of one query as input for another.

      Specified by:
      run in interface ReactiveQueryRunner
      Parameters:
      query - text of a Neo4j query
      parameters - input data for the query
      Returns:
      a publisher of reactive result.
    • run

      default org.reactivestreams.Publisher<ReactiveResult> run(String queryStr)
      Description copied from interface: ReactiveQueryRunner
      Register running of a query and return a publisher of ReactiveResult.

      Invoking this method will result in a Bolt RUN message exchange with server and the returned publisher will either emit an instance of ReactiveResult on success or an error otherwise.

      Specified by:
      run in interface ReactiveQueryRunner
      Parameters:
      queryStr - text of a Neo4j query
      Returns:
      a publisher of reactive result.