Class InternalReactiveTransaction
- All Implemented Interfaces:
ReactiveQueryRunner,ReactiveTransaction
-
Field Summary
Fields inherited from class org.neo4j.driver.internal.reactive.AbstractReactiveTransaction
tx -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInternalReactiveTransaction(UnmanagedTransaction tx, DriverObservationProvider observationProvider) -
Method Summary
Modifier and TypeMethodDescriptionclose()Close the transaction.<T> Flow.Publisher<T> commit()Commits the transaction.isOpen()Determine if transaction is open.<T> Flow.Publisher<T> rollback()Rolls back the transaction.default Flow.Publisher<ReactiveResult> Register running of a query and return a publisher ofReactiveResult.default Flow.Publisher<ReactiveResult> Register running of a query and return a publisher ofReactiveResult.default Flow.Publisher<ReactiveResult> Register running of a query and return a publisher ofReactiveResult.default Flow.Publisher<ReactiveResult> Register running of a query and return a publisher ofReactiveResult.Register running of a query and return a publisher ofReactiveResult.Methods inherited from class org.neo4j.driver.internal.reactive.AbstractReactiveTransaction
close, doClose, doCommit, doIsOpen, doRollback
-
Constructor Details
-
InternalReactiveTransaction
protected InternalReactiveTransaction(UnmanagedTransaction tx, DriverObservationProvider observationProvider)
-
-
Method Details
-
run
Description copied from interface:ReactiveQueryRunnerRegister running of a query and return a publisher ofReactiveResult.Invoking this method will result in a Bolt RUN message exchange with server and the returned publisher will either emit an instance of
ReactiveResulton success or an error otherwise.- Specified by:
runin interfaceReactiveQueryRunner- Parameters:
query- a Neo4j query- Returns:
- a publisher of reactive result.
-
commit
Description copied from interface:ReactiveTransactionCommits the transaction. It completes without publishing anything if transaction is committed successfully. Otherwise, errors when there is any error to commit.- Specified by:
commitin interfaceReactiveTransaction- Type Parameters:
T- makes it easier to be chained after other publishers.- Returns:
- an empty publisher.
-
rollback
Description copied from interface:ReactiveTransactionRolls 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:
rollbackin interfaceReactiveTransaction- Type Parameters:
T- makes it easier to be chained after other publishers.- Returns:
- an empty publisher.
-
close
Description copied from interface:ReactiveTransactionClose the transaction. If the transaction has beencommittedorrolled back, the close is optional and no operation is performed. Otherwise, the transaction will be rolled back by default by this method.- Specified by:
closein interfaceReactiveTransaction- Returns:
- new
Flow.Publisherthat gets completed when close is successful, otherwise an error is signalled.
-
isOpen
Description copied from interface:ReactiveTransactionDetermine if transaction is open.- Specified by:
isOpenin interfaceReactiveTransaction- Returns:
- a publisher emitting
trueif transaction is open andfalseotherwise.
-
run
Description copied from interface:ReactiveQueryRunnerRegister running of a query and return a publisher ofReactiveResult.Invoking this method will result in a Bolt RUN message exchange with server and the returned publisher will either emit an instance of
ReactiveResulton 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
Valueas 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 aValuefor you.- Specified by:
runin interfaceReactiveQueryRunner- Parameters:
queryStr- text of a Neo4j queryparameters- input parameters, should be a map Value, seeValues.parameters(Object...).- Returns:
- a publisher of reactive result.
-
run
Description copied from interface:ReactiveQueryRunnerRegister running of a query and return a publisher ofReactiveResult.Invoking this method will result in a Bolt RUN message exchange with server and the returned publisher will either emit an instance of
ReactiveResulton 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
Mapof parameters. The values in the map must be values that can be converted to Neo4j types. SeeValues.parameters(Object...)for a list of allowed types.- Specified by:
runin interfaceReactiveQueryRunner- Parameters:
query- text of a Neo4j queryparameters- input data for the query- Returns:
- a publisher of reactive result.
-
run
Description copied from interface:ReactiveQueryRunnerRegister running of a query and return a publisher ofReactiveResult.Invoking this method will result in a Bolt RUN message exchange with server and the returned publisher will either emit an instance of
ReactiveResulton 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
Recordof parameters, which can be useful if you want to use the output of one query as input for another.- Specified by:
runin interfaceReactiveQueryRunner- Parameters:
query- text of a Neo4j queryparameters- input data for the query- Returns:
- a publisher of reactive result.
-
run
Description copied from interface:ReactiveQueryRunnerRegister running of a query and return a publisher ofReactiveResult.Invoking this method will result in a Bolt RUN message exchange with server and the returned publisher will either emit an instance of
ReactiveResulton success or an error otherwise.- Specified by:
runin interfaceReactiveQueryRunner- Parameters:
queryStr- text of a Neo4j query- Returns:
- a publisher of reactive result.
-