- All Implemented Interfaces:
BaseSession
,RxQueryRunner
,RxSession
-
Field Summary
Fields inherited from class org.neo4j.driver.internal.reactive.AbstractReactiveSession
session
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.reactivestreams.Publisher<RxTransaction>
beginTransaction
(TransactionConfig config) Deprecated.Begin a new unmanaged transaction with the specifiedconfiguration
.<T> org.reactivestreams.Publisher<T>
close()
Deprecated.Signal that you are done using this session.protected org.reactivestreams.Publisher<Void>
closeTransaction
(RxTransaction transaction, boolean commit) Deprecated.protected RxTransaction
createTransaction
(UnmanagedTransaction unmanagedTransaction) Deprecated.Deprecated.Return the last bookmark of this session.<T> org.reactivestreams.Publisher<T>
readTransaction
(RxTransactionWork<? extends org.reactivestreams.Publisher<T>> work) Deprecated.Execute given unit of reactive work in aread
reactive transaction.<T> org.reactivestreams.Publisher<T>
readTransaction
(RxTransactionWork<? extends org.reactivestreams.Publisher<T>> work, TransactionConfig config) Deprecated.Execute given unit of reactive work in aread
reactive transaction with the specifiedconfiguration
.Deprecated.Run a query with parameters in an auto-commit transaction with specifiedTransactionConfig
and return a reactive result stream.run
(String query, TransactionConfig config) Deprecated.Run a query with parameters in an auto-commit transaction with specifiedTransactionConfig
and return a reactive result stream.Deprecated.Register running of a query and return a reactive result stream.run
(Query query, TransactionConfig config) Deprecated.Run a query in an auto-commit transaction with specifiedconfiguration
and return a reactive result stream.<T> org.reactivestreams.Publisher<T>
writeTransaction
(RxTransactionWork<? extends org.reactivestreams.Publisher<T>> work) Deprecated.Execute given unit of reactive work in awrite
reactive transaction.<T> org.reactivestreams.Publisher<T>
writeTransaction
(RxTransactionWork<? extends org.reactivestreams.Publisher<T>> work, TransactionConfig config) Deprecated.Execute given unit of reactive work in awrite
reactive transaction with the specifiedconfiguration
.Methods inherited from class org.neo4j.driver.internal.reactive.AbstractReactiveSession
doBeginTransaction, doClose, lastBookmarks, run, runTransaction
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.neo4j.driver.reactive.RxQueryRunner
run, run, run, run
Methods inherited from interface org.neo4j.driver.reactive.RxSession
beginTransaction
-
Constructor Details
-
InternalRxSession
Deprecated.
-
-
Method Details
-
createTransaction
Deprecated.- Specified by:
createTransaction
in classAbstractReactiveSession<RxTransaction>
-
closeTransaction
protected org.reactivestreams.Publisher<Void> closeTransaction(RxTransaction transaction, boolean commit) Deprecated.- Specified by:
closeTransaction
in classAbstractReactiveSession<RxTransaction>
-
beginTransaction
Deprecated.Description copied from interface:RxSession
Begin a new unmanaged transaction with the specifiedconfiguration
. At most one transaction may exist in a session at any point in time. To maintain multiple concurrent transactions, use multiple concurrent sessions.It by default is executed in a Network IO thread, as a result no blocking operation is allowed in this thread.
- Specified by:
beginTransaction
in interfaceRxSession
- Parameters:
config
- configuration for the new transaction.- Returns:
- a new
RxTransaction
-
readTransaction
public <T> org.reactivestreams.Publisher<T> readTransaction(RxTransactionWork<? extends org.reactivestreams.Publisher<T>> work) Deprecated.Description copied from interface:RxSession
Execute given unit of reactive work in aread
reactive transaction.Transaction will automatically be committed unless given unit of work fails or
transaction commit
fails. It will also not be committed if explicitly rolled back viaRxTransaction.rollback()
.Returned publisher and given
RxTransactionWork
is completed/executed by an IO thread which should never block. Otherwise IO operations on this and potentially other network connections might deadlock. Please do not chain blocking operations likeCompletableFuture.get()
on the returned publisher and do not use them inside theRxTransactionWork
.- Specified by:
readTransaction
in interfaceRxSession
- Type Parameters:
T
- the return type of the given unit of work.- Parameters:
work
- theRxTransactionWork
to be applied to a new read transaction. Operation executed by the given work must NOT include any blocking operation.- Returns:
- a
publisher
completed with the same result as returned by the given unit of work. publisher can be completed exceptionally if given work or commit fails.
-
readTransaction
public <T> org.reactivestreams.Publisher<T> readTransaction(RxTransactionWork<? extends org.reactivestreams.Publisher<T>> work, TransactionConfig config) Deprecated.Description copied from interface:RxSession
Execute given unit of reactive work in aread
reactive transaction with the specifiedconfiguration
.Transaction will automatically be committed unless given unit of work fails or
transaction commit
fails. It will also not be committed if explicitly rolled back viaRxTransaction.rollback()
.Returned publisher and given
RxTransactionWork
is completed/executed by an IO thread which should never block. Otherwise IO operations on this and potentially other network connections might deadlock. Please do not chain blocking operations likeCompletableFuture.get()
on the returned publisher and do not use them inside theRxTransactionWork
.- Specified by:
readTransaction
in interfaceRxSession
- Type Parameters:
T
- the return type of the given unit of work.- Parameters:
work
- theRxTransactionWork
to be applied to a new read transaction. Operation executed by the given work must NOT include any blocking operation.config
- the transaction configuration.- Returns:
- a
publisher
completed with the same result as returned by the given unit of work. publisher can be completed exceptionally if given work or commit fails.
-
writeTransaction
public <T> org.reactivestreams.Publisher<T> writeTransaction(RxTransactionWork<? extends org.reactivestreams.Publisher<T>> work) Deprecated.Description copied from interface:RxSession
Execute given unit of reactive work in awrite
reactive transaction.Transaction will automatically be committed unless given unit of work fails or
transaction commit
fails. It will also not be committed if explicitly rolled back viaRxTransaction.rollback()
.Returned publisher and given
RxTransactionWork
is completed/executed by an IO thread which should never block. Otherwise IO operations on this and potentially other network connections might deadlock. Please do not chain blocking operations likeCompletableFuture.get()
on the returned publisher and do not use them inside theRxTransactionWork
.- Specified by:
writeTransaction
in interfaceRxSession
- Type Parameters:
T
- the return type of the given unit of work.- Parameters:
work
- theRxTransactionWork
to be applied to a new read transaction. Operation executed by the given work must NOT include any blocking operation.- Returns:
- a
publisher
completed with the same result as returned by the given unit of work. publisher can be completed exceptionally if given work or commit fails.
-
writeTransaction
public <T> org.reactivestreams.Publisher<T> writeTransaction(RxTransactionWork<? extends org.reactivestreams.Publisher<T>> work, TransactionConfig config) Deprecated.Description copied from interface:RxSession
Execute given unit of reactive work in awrite
reactive transaction with the specifiedconfiguration
.Transaction will automatically be committed unless given unit of work fails or
transaction commit
fails. It will also not be committed if explicitly rolled back viaRxTransaction.rollback()
.Returned publisher and given
RxTransactionWork
is completed/executed by an IO thread which should never block. Otherwise IO operations on this and potentially other network connections might deadlock. Please do not chain blocking operations likeCompletableFuture.get()
on the returned publisher and do not use them inside theRxTransactionWork
.- Specified by:
writeTransaction
in interfaceRxSession
- Type Parameters:
T
- the return type of the given unit of work.- Parameters:
work
- theRxTransactionWork
to be applied to a new read transaction. Operation executed by the given work must NOT include any blocking operation.config
- the transaction configuration.- Returns:
- a
publisher
completed with the same result as returned by the given unit of work. publisher can be completed exceptionally if given work or commit fails.
-
run
Deprecated.Description copied from interface:RxSession
Run a query with parameters in an auto-commit transaction with specifiedTransactionConfig
and return a reactive result stream. The query is not executed when the reactive result is returned. Instead, the publishers in the result will actually start the execution of the query. -
run
Deprecated.Description copied from interface:RxSession
Run a query with parameters in an auto-commit transaction with specifiedTransactionConfig
and return a reactive result stream. The query is not executed when the reactive result is returned. Instead, the publishers in the result will actually start the execution of the query.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. SeeValues.parameters(Object...)
for a list of allowed types.Example
Map<String, Object> metadata = new HashMap<>(); metadata.put("type", "update name"); TransactionConfig config = TransactionConfig.builder() .withTimeout(Duration.ofSeconds(3)) .withMetadata(metadata) .build(); Map<String, Object> parameters = new HashMap<>(); parameters.put("myNameParam", "Bob"); RxResult result = rxSession.run("MATCH (n) WHERE n.name = $myNameParam RETURN (n)", parameters, config);
-
run
Deprecated.Description copied from interface:RxQueryRunner
Register running of a query and return a reactive result stream. The query is not executed when the reactive result is returned. Instead, the publishers in the result will actually start the execution of the query.- Specified by:
run
in interfaceRxQueryRunner
- Parameters:
query
- a Neo4j query- Returns:
- a reactive result.
-
run
Deprecated.Description copied from interface:RxSession
Run a query in an auto-commit transaction with specifiedconfiguration
and return a reactive result stream. The query is not executed when the reactive result is returned. Instead, the publishers in the result will actually start the execution of the query.Example
Map<String, Object> metadata = new HashMap<>(); metadata.put("type", "update name"); TransactionConfig config = TransactionConfig.builder() .withTimeout(Duration.ofSeconds(3)) .withMetadata(metadata) .build(); Query query = new Query("MATCH (n) WHERE n.name = $myNameParam RETURN n.age"); RxResult result = rxSession.run(query.withParameters(Values.parameters("myNameParam", "Bob")));
-
lastBookmark
Deprecated.Description copied from interface:RxSession
Return the last bookmark of this session.When no new bookmark is received, the initial bookmarks are returned as a composite
Bookmark
containing all initial bookmarks. This may happen when no work has been done using the session. If no initial bookmarks have been provided, an emptyBookmark
is returned.- Specified by:
lastBookmark
in interfaceRxSession
- Returns:
- the last bookmark.
-
close
public <T> org.reactivestreams.Publisher<T> close()Deprecated.Description copied from interface:RxSession
Signal that you are done using this session. In the default driver usage, closing and accessing sessions is very low cost.This operation is not needed if 1) all results created in the session have been fully consumed and 2) all transactions opened by this session have been either committed or rolled back.
This method is a fallback if you failed to fulfill the two requirements above. This publisher is completed when all outstanding queries in the session have completed, meaning any writes you performed are guaranteed to be durably stored. It might be completed exceptionally when there are unconsumed errors from previous queries or transactions.
-