public static class SessionConfig.Builder extends Object
SessionConfig
which will be used to create a session.Modifier and Type | Method and Description |
---|---|
SessionConfig |
build() |
SessionConfig.Builder |
withBookmarks(Bookmark... bookmarks)
Set the initial bookmarks to be used in a session.
|
SessionConfig.Builder |
withBookmarks(Iterable<Bookmark> bookmarks)
Set the initial bookmarks to be used in a session.
|
SessionConfig.Builder |
withDatabase(String database)
Set the database that the newly created session is going to connect to.
|
SessionConfig.Builder |
withDefaultAccessMode(AccessMode mode)
Set the type of access required by units of work in this session,
e.g.
|
SessionConfig.Builder |
withFetchSize(long size)
Specify how many records to fetch in each batch for this session.
|
public SessionConfig.Builder withBookmarks(Bookmark... bookmarks)
First transaction in a session will ensure that server hosting is at least as up-to-date as the
latest transaction referenced by the supplied bookmarks.
The bookmarks can be obtained via Session.lastBookmark()
, AsyncSession.lastBookmark()
,
and/or RxSession.lastBookmark()
.
bookmarks
- a series of initial bookmarks.
Both null
value and empty array
are permitted, and indicate that the bookmarks do not exist or are unknown.public SessionConfig.Builder withBookmarks(Iterable<Bookmark> bookmarks)
Session.lastBookmark()
, AsyncSession.lastBookmark()
,
and/or RxSession.lastBookmark()
.bookmarks
- initial references to some previous transactions. Both null
value and empty iterable
are permitted, and indicate that the bookmarks do not exist or are unknown.public SessionConfig.Builder withDefaultAccessMode(AccessMode mode)
read access
or write access
.
This access mode is used to route transactions in the session to the server who has the right to carry out the specified operations.mode
- access mode.public SessionConfig.Builder withDatabase(String database)
For connecting to servers that support multi-databases,
it is highly recommended to always set the database explicitly in the SessionConfig
for each session.
If the database name is not set, then session defaults to connecting to the default database configured in server configuration.
For servers that do not support multi-databases, leave this database value unset. The only database will be used instead.
database
- the database the session going to connect to. Provided value should not be null
.public SessionConfig.Builder withFetchSize(long size)
Config.fetchSize()
.
This config is only valid when the driver is used with servers that support Bolt V4 (Server version 4.0 and later).
Bolt V4 enables pulling records in batches to allow client to take control of data population and apply back pressure to server.
This config specifies the default fetch size for all query runs using Session
and AsyncSession
.
By default, the value is set to 1000
.
Use -1
to disables back pressure and config client to pull all records at once after each run.
This config only applies to run result obtained via Session
and AsyncSession
.
As with RxSession
, the batch size is provided via Subscription.request(long)
instead.size
- the default record fetch size when pulling records in batches using Bolt V4.public SessionConfig build()
Copyright © 2019. All rights reserved.