Home Reference Source
import RxTransaction from 'neo4j-driver/lib/transaction-rx.js'
public class | source

RxTransaction

A reactive transaction, which provides the same functionality as Transaction but through a Reactive API.

Method Summary

Public Methods
public

close(): Observable

Closes the transaction

public

commit(): Observable

Commits the transaction.

public

isOpen(): boolean

Check if this transaction is active, which means commit and rollback did not happen.

public

rollback(): Observable

Rolls back the transaction.

public

run(query: string, parameters: Object): RxResult

Creates a reactive result that will execute the query in this transaction, with the provided parameters.

Public Methods

public close(): Observable source

Closes the transaction

This method will roll back the transaction if it is not already committed or rolled back.

Return:

Observable

An empty observable

public commit(): Observable source

Commits the transaction.

Return:

Observable

An empty observable

public isOpen(): boolean source

Check if this transaction is active, which means commit and rollback did not happen.

Return:

boolean

true when not committed and not rolled back, false otherwise.

public rollback(): Observable source

Rolls back the transaction.

Return:

Observable

An empty observable

public run(query: string, parameters: Object): RxResult source

Creates a reactive result that will execute the query in this transaction, with the provided parameters.

Params:

NameTypeAttributeDescription
query string

Query to be executed.

parameters Object

Parameter values to use in query execution.

Return:

RxResult

A reactive result