public class DBTransaction
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
commit()
Commits this non-autocommit transaction.
|
Relation |
compileAndCacheQuery(java.lang.String query)
Deprecated.
- support for the COMPILE/CACHE commands has been dropped. Replace with INQUIRE __EXPRESSIONINFO(query).
|
Relation |
compileQuery(java.lang.String query)
Deprecated.
- support for the COMPILE command has been dropped. Replace with INQUIRE __EXPRESSIONINFO(query).
|
void |
end(boolean commit)
Ends the transaction, issuing either a commit or a rollback.
|
Relation |
execDmlCommand(java.lang.String cmd)
Deprecated.
- replace with execServerCommand(ServerCommand.getCommandObjectFrom(cmd))
|
Relation |
execDmlCommandAndEndTransaction(java.lang.String cmd)
Deprecated.
- replace with execServerCommand(ServerCommand.getCommandFrom(cmd))
|
Relation |
execMultipleStatementAndEndTransaction(java.lang.String[] commands)
Deprecated.
- replace with execServerCommandAndEndTransaction(new ServerMultipleAssignmentCommand(...))
|
Relation[] |
execQueries(java.lang.String... expressions)
Executes a series of inquire commands on the server.
|
Relation[] |
execQueriesAndEndTransaction(java.lang.String... expressions)
Executes a series of inquire commands on the server.
|
Relation |
execQuery(java.lang.String expression)
Executes an inquire command on the server.
|
Relation |
execQuery(java.lang.String expression,
java.util.List<java.lang.String> orderByAttributeNames)
Executes an inquire command on the server.
|
Relation |
execQueryAndEndTransaction(java.lang.String expression)
Executes an inquire command on the server.
|
Relation |
execQueryAndEndTransaction(java.lang.String expression,
java.util.List<java.lang.String> orderByAttributeNames)
Executes an inquire command on the server.
|
Relation |
execServerCommand(ServerCommand serverCommand)
Sends a command to the server and returns the result obtained.
|
Relation |
execServerCommandAndEndTransaction(ServerCommand serverCommand)
Sends a command to the server and returns the result obtained.
|
DBTransaction |
getParentTransaction()
Gets The "parent" transaction of this nested transaction, or null if this is not a nested transaction
|
long |
getTransactionID()
Gets The numerical server-side ID of the started transaction, or -1 if the server is pre 1.2
|
boolean |
isAutoCommit()
Gets the flag indicating whether all DML statements executed in the transaction should be automatically committed
|
boolean |
isReadOnly()
Gets the Flag indicating whether the transaction is read-only
|
void |
rollback()
Commits this non-autocommit transaction.
|
DBTransaction |
savePoint()
Takes a savepoint in the current transaction.
|
DBTransaction |
startNestedTransaction(boolean newAutoCommit,
boolean readOnly)
Starts a nested transaction within this transaction.
|
java.lang.String |
toString() |
public final void commit() throws ConnectionClosedException
ConnectionClosedException
- If the connection was closed due to an I/O error that occurred during communication with the server, or if the commit failed.@Deprecated public final Relation compileAndCacheQuery(java.lang.String query) throws ConnectionClosedException, ErrorMessageException
query
- the query to be compiled-and-cached, in textual form.ConnectionClosedException
- If the connection was closed due to an I/O error that occurred during communication with the serverErrorMessageException
- If the response obtained from the server is not a commit confirmation, but an error response instead.@Deprecated public final Relation compileQuery(java.lang.String query) throws ConnectionClosedException, ErrorMessageException
query
- the query to be verified, in textual form.ConnectionClosedException
- If the connection was closed due to an I/O error that occurred during communication with the serverErrorMessageException
- If the response obtained from the server is not a commit confirmation, but an error response instead.public final void end(boolean commit) throws ConnectionClosedException
commit
- true if the transaction is to be committed, false if it is to be rolled back.ConnectionClosedException
- If the connection was closed due to an I/O error that occurred during communication with the server@Deprecated public final Relation execDmlCommand(java.lang.String cmd) throws ConnectionClosedException, ErrorMessageException
cmd
- the command to be executed, in textual form.ConnectionClosedException
- If the connection was closed due to an I/O error that occurred during communication with the serverErrorMessageException
- If the response obtained from the server is not a commit confirmation, but an error response instead.public final Relation execServerCommandAndEndTransaction(ServerCommand serverCommand) throws ConnectionClosedException, ErrorMessageException
serverCommand
- the command to be executed.ConnectionClosedException
- If the connection was closed due to an I/O error that occurred during communication with the serverErrorMessageException
- If the response obtained from the server is not a commit confirmation, but an error response instead.@Deprecated public final Relation execDmlCommandAndEndTransaction(java.lang.String cmd) throws ConnectionClosedException, ErrorMessageException
cmd
- the command to be executed, in textual form.ConnectionClosedException
- If the connection was closed due to an I/O error that occurred during communication with the serverErrorMessageException
- If the response obtained from the server is not a commit confirmation, but an error response instead.@Deprecated public final Relation execMultipleStatementAndEndTransaction(java.lang.String[] commands) throws ConnectionClosedException, ErrorMessageException
commands
- The single-assignment commands to be executed. Execution is in the obvious order, and thus not randomly, or in reverse order, or whatever.ConnectionClosedException
- If the connection was closed due to an I/O error that occurred during communication with the serverErrorMessageException
- If the response obtained from the server is not a commit confirmation, but an error response instead.public final Relation[] execQueries(java.lang.String... expressions) throws ConnectionClosedException, ErrorMessageException
expressions
- The expressions of the relational algebra to be inquired.ConnectionClosedException
- If the connection was closed due to an I/O error that occurred during communication with the serverErrorMessageException
- If the response obtained from the server is not a commit confirmation, but an error response instead.public final Relation[] execQueriesAndEndTransaction(java.lang.String... expressions) throws ConnectionClosedException, ErrorMessageException
expressions
- The expressions of the relational algebra to be inquired.ConnectionClosedException
- If the connection was closed due to an I/O error that occurred during communication with the serverErrorMessageException
- If the response obtained from the server is not a commit confirmation, but an error response instead.public final Relation execQuery(java.lang.String expression) throws ConnectionClosedException, ErrorMessageException
expression
- The expression of the relational algebra to be inquired.ConnectionClosedException
- If the connection was closed due to an I/O error that occurred during communication with the serverErrorMessageException
- If the response obtained from the server is not a commit confirmation, but an error response instead.public final Relation execQuery(java.lang.String expression, java.util.List<java.lang.String> orderByAttributeNames) throws ConnectionClosedException, ErrorMessageException
expression
- The expression of the relational algebra to be inquired.orderByAttributeNames
- The spec of the requested ordering for the tuples in the resulting relationConnectionClosedException
- If the connection was closed due to an I/O error that occurred during communication with the serverErrorMessageException
- If the response obtained from the server is not a commit confirmation, but an error response instead.public final Relation execQueryAndEndTransaction(java.lang.String expression) throws ConnectionClosedException, ErrorMessageException
expression
- The expression of the relational algebra to be inquired.ConnectionClosedException
- If the connection was closed due to an I/O error that occurred during communication with the serverErrorMessageException
- If the response obtained from the server is not a commit confirmation, but an error response instead.public final Relation execQueryAndEndTransaction(java.lang.String expression, java.util.List<java.lang.String> orderByAttributeNames) throws ConnectionClosedException, ErrorMessageException
expression
- The expression of the relational algebra to be inquired.orderByAttributeNames
- The spec of the requested ordering for the tuples in the resulting relationConnectionClosedException
- If the connection was closed due to an I/O error that occurred during communication with the serverErrorMessageException
- If the response obtained from the server is not a commit confirmation, but an error response instead.public final Relation execServerCommand(ServerCommand serverCommand) throws ConnectionClosedException, ErrorMessageException
serverCommand
- the command to be executed.ConnectionClosedException
- If the connection was closed due to an I/O error that occurred during communication with the serverErrorMessageException
- If the response obtained from the server is not a commit confirmation, but an error response instead.public final DBTransaction getParentTransaction()
public final long getTransactionID()
public final boolean isAutoCommit()
public final boolean isReadOnly()
public final void rollback() throws ConnectionClosedException
ConnectionClosedException
- If the connection was closed due to an I/O error that occurred during communication with the serverpublic final DBTransaction savePoint() throws ErrorMessageException, ConnectionClosedException
ConnectionClosedException
- If the connection was closed due to an I/O error that occurred during communication with the serverErrorMessageException
- If the response obtained from the server is not a confirmation, but an error response instead.public final DBTransaction startNestedTransaction(boolean newAutoCommit, boolean readOnly) throws ErrorMessageException, ConnectionClosedException
newAutoCommit
- The autocommit setting for the new transaction nested inside the current onereadOnly
- The readOnly setting for the new transaction nested inside the current one. May only be false if this transaction is not read-only too.ConnectionClosedException
- If the connection was closed due to an I/O error that occurred during communication with the serverErrorMessageException
- If the response obtained from the server is not a confirmation, but an error response instead.public java.lang.String toString()
toString
in class java.lang.Object