Bolt V3 support & transaction configuration #403
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bolt V3 allows additional metadata to be attached to BEGIN and RUN messages. This makes it possible to expose a couple new features in the API.
Auto-commit transactions executed via
Session#run()
now support bookmarks. In previous protocol versions, there was no good place in the RUN message to attach bookmarks. Auto-commit transactions will now use bookmarks given inDriver#session(bookmarkOrBookmarks)
function and participate in causal chaining within a session.Transactions functions, auto-commit, and explicit transactions now accept a configuration object with transaction timeout and metadata. Example of a configuration object:
where timeout is specified in milliseconds and metadata is an object containing valid Cypher types.
Transactions that execute longer than the configured timeout will be terminated by the database. This functionality allows limiting query/transaction execution time. Specified timeout overrides the default timeout configured in the database using
dbms.transaction.timeout
setting. Examples:Specified transaction metadata will be attached to the executing transaction and visible in the output of
dbms.listQueries
anddbms.listTransactions
procedures. It will also get logged to thequery.log
. This functionality makes it easier to tag transactions and is equivalent todbms.setTXMetaData
procedure.Examples: