Class VelrTx
- All Implemented Interfaces:
AutoCloseable
A transaction owns result streams, result tables, rows, and savepoints opened from it. Commit, roll back, or close the transaction when it is no longer needed. Closing a transaction closes any still-open child handles first.
-
Method Summary
Modifier and TypeMethodDescriptionvoidbindArrow(String logical, ArrowColumn... columns) Bind single-chunk Arrow C Data Interface columns as a logical table within this transaction.voidbindArrow(String logical, List<ArrowColumn> columns) Bind single-chunk Arrow C Data Interface columns as a logical table within this transaction.voidbindArrowChunks(String logical, ArrowColumn... columns) Bind chunked Arrow C Data Interface columns as a logical table within this transaction.voidbindArrowChunks(String logical, List<ArrowColumn> columns) Bind chunked Arrow C Data Interface columns as a logical table within this transaction.voidbindArrowIpc(String logical, byte[] ipcBytes) Bind Arrow IPC file / Feather v2 bytes as a logical table within this transaction.voidclose()Close this transaction without committing it.voidcommit()Commit this transaction.Execute an openCypher statement inside this transaction and stream every result table it produces.exec(String cypher, QueryOptions options) Execute an openCypher statement with query options inside this transaction and stream every result table it produces.Execute an openCypher statement inside this transaction that is expected to produce exactly one result table.execOne(String cypher, QueryOptions options) Execute an openCypher statement with query options inside this transaction that is expected to produce exactly one result table.booleanisClosed()Return whether this transaction has been closed, committed, or rolled back.Execute an openCypher statement inside this transaction and collect the single result table as object maps.query(String cypher, QueryOptions options) Execute an openCypher statement with query options inside this transaction and collect the single result table as object maps.voidregisterChild(ai.velr.ChildHandle child) Driver-internal child-handle registration hook.voidreleaseSavepoint(String name) Release an active named savepoint.voidrollback()Roll back this transaction.voidrollbackTo(String name) Roll back this transaction to an active named savepoint.voidExecute an openCypher statement inside this transaction and discard any result tables.voidrun(String cypher, QueryOptions options) Execute an openCypher statement with query options inside this transaction and discard any result tables.Create a scoped savepoint.savepointNamed(String name) Create a named savepoint.voidunregisterChild(ai.velr.ChildHandle child) Driver-internal child-handle registration hook.
-
Method Details
-
isClosed
public boolean isClosed()Return whether this transaction has been closed, committed, or rolled back.- Returns:
trueafter the transaction handle is no longer open
-
exec
Execute an openCypher statement inside this transaction and stream every result table it produces.- Parameters:
cypher- openCypher statement- Returns:
- a stream of result tables
-
exec
Execute an openCypher statement with query options inside this transaction and stream every result table it produces.- Parameters:
cypher- openCypher statementoptions- query options such as parameters and row limits- Returns:
- a stream of result tables
-
execOne
Execute an openCypher statement inside this transaction that is expected to produce exactly one result table.- Parameters:
cypher- openCypher statement- Returns:
- the single result table
-
execOne
Execute an openCypher statement with query options inside this transaction that is expected to produce exactly one result table.- Parameters:
cypher- openCypher statementoptions- query options such as parameters and row limits- Returns:
- the single result table
-
run
Execute an openCypher statement inside this transaction and discard any result tables.- Parameters:
cypher- openCypher statement
-
run
Execute an openCypher statement with query options inside this transaction and discard any result tables.- Parameters:
cypher- openCypher statementoptions- query options such as parameters and row limits
-
query
Execute an openCypher statement inside this transaction and collect the single result table as object maps.- Parameters:
cypher- openCypher statement- Returns:
- collected rows
-
query
Execute an openCypher statement with query options inside this transaction and collect the single result table as object maps.- Parameters:
cypher- openCypher statementoptions- query options such as parameters and row limits- Returns:
- collected rows
-
bindArrowIpc
Bind Arrow IPC file / Feather v2 bytes as a logical table within this transaction.The byte array is borrowed only for the duration of the call. Velr decodes the IPC file and owns the resulting Arrow arrays before this method returns. Arrow IPC stream bytes are not accepted by this method.
- Parameters:
logical- logical table name to expose to queriesipcBytes- Arrow IPC file / Feather v2 bytes
-
bindArrow
Bind single-chunk Arrow C Data Interface columns as a logical table within this transaction.For each column, the
ArrowArrayaddress is transferred to Velr by this call. Do not use or release transferred arrays after calling this method. TheArrowSchemaaddress is not consumed and may be released after this method returns.- Parameters:
logical- logical table name to expose to queriescolumns- one or more Arrow columns
-
bindArrow
Bind single-chunk Arrow C Data Interface columns as a logical table within this transaction.- Parameters:
logical- logical table name to expose to queriescolumns- one or more Arrow columns
-
bindArrowChunks
Bind chunked Arrow C Data Interface columns as a logical table within this transaction.Each column may contain one or more chunks. For every chunk, the
ArrowArrayaddress is transferred to Velr by this call. Do not use or release transferred arrays after calling this method. TheArrowSchemaaddress is not consumed and may be released after this method returns.- Parameters:
logical- logical table name to expose to queriescolumns- one or more Arrow columns
-
bindArrowChunks
Bind chunked Arrow C Data Interface columns as a logical table within this transaction.- Parameters:
logical- logical table name to expose to queriescolumns- one or more Arrow columns
-
savepoint
Create a scoped savepoint.The returned savepoint can be released or rolled back directly. Close the savepoint if it is no longer needed and no action should be taken.
- Returns:
- an open savepoint handle
-
savepointNamed
Create a named savepoint.Named savepoints can be addressed later with
rollbackTo(String)andreleaseSavepoint(String)while they remain active.- Parameters:
name- savepoint name- Returns:
- an open savepoint handle
-
rollbackTo
Roll back this transaction to an active named savepoint.The target savepoint remains active after rollback; savepoints created after it are no longer active.
- Parameters:
name- savepoint name
-
releaseSavepoint
Release an active named savepoint.Velr releases named savepoints from the top of the savepoint stack.
- Parameters:
name- savepoint name
-
commit
public void commit()Commit this transaction.After commit, this transaction handle is closed and cannot be reused.
-
rollback
public void rollback()Roll back this transaction.After rollback, this transaction handle is closed and cannot be reused.
-
close
public void close()Close this transaction without committing it.- Specified by:
closein interfaceAutoCloseable
-
registerChild
public void registerChild(ai.velr.ChildHandle child) Driver-internal child-handle registration hook. -
unregisterChild
public void unregisterChild(ai.velr.ChildHandle child) Driver-internal child-handle registration hook.
-