SessionInterface

A local or remote session. A session represents a database connection.

Methods
void addTemporaryLob(Value v)
Add a temporary LOB, which is closed when the session commits.
void addTemporaryLob(Value v)
Add a temporary LOB, which is closed when the session commits.
Parameters:
v - the value
void cancel()
Cancel the current or next command (called when closing a connection).
void cancel()
Cancel the current or next command (called when closing a connection).
void close()
Roll back pending transactions and close the session.
void close()
Roll back pending transactions and close the session.
boolean getAutoCommit()
Check if this session is in auto-commit mode.
boolean getAutoCommit()
Check if this session is in auto-commit mode.
Returns:
true if the session is in auto-commit mode
ArrayList getClusterServers()
Get the list of the cluster servers for this session.
ArrayList getClusterServers()
Get the list of the cluster servers for this session.
Returns:
A list of "ip:port" strings for the cluster servers in this session.
String getCurrentSchemaName()
Get current schema.
String getCurrentSchemaName()
Get current schema.
Returns:
the current schema name
DataHandler getDataHandler()
Get the data handler object.
DataHandler getDataHandler()
Get the data handler object.
Returns:
the data handler
IsolationLevel getIsolationLevel()
Returns the isolation level.
IsolationLevel getIsolationLevel()
Returns the isolation level.
Returns:
the isolation level
int getPowerOffCount()
Get the number of disk operations before power failure is simulated.
int getPowerOffCount()
Get the number of disk operations before power failure is simulated. This is used for testing. If not set, 0 is returned
Returns:
the number of operations, or 0
Trace getTrace()
Get the trace object
Trace getTrace()
Get the trace object
Returns:
the trace object
boolean hasPendingTransaction()
Check whether this session has a pending transaction.
boolean hasPendingTransaction()
Check whether this session has a pending transaction.
Returns:
true if it has
boolean isClosed()
Check if close was called.
boolean isClosed()
Check if close was called.
Returns:
if the session has been closed
boolean isRemote()
Check if this session is remote or embedded.
boolean isRemote()
Check if this session is remote or embedded.
Returns:
true if this session is remote
boolean isSupportsGeneratedKeys()
Returns is this session supports generated keys.
boolean isSupportsGeneratedKeys()
Returns is this session supports generated keys.
Returns:
{@code true} if generated keys are supported, {@code false} if only {@code SCOPE_IDENTITY()} is supported
CommandInterface prepareCommand(String sql, int fetchSize)
Parse a command and prepare it for execution.
CommandInterface prepareCommand(String sql, int fetchSize)
Parse a command and prepare it for execution.
Parameters:
sql - the SQL statement
fetchSize - the number of rows to fetch in one step
Returns:
the prepared command
void setAutoCommit(boolean autoCommit)
Set the auto-commit mode.
void setAutoCommit(boolean autoCommit)
Set the auto-commit mode. This call doesn't commit the current transaction.
Parameters:
autoCommit - the new value
void setCurrentSchemaName(String schema)
Set current schema.
void setCurrentSchemaName(String schema)
Set current schema.
Parameters:
schema - the schema name
void setIsolationLevel(IsolationLevel isolationLevel)
Sets the isolation level.
void setIsolationLevel(IsolationLevel isolationLevel)
Sets the isolation level.
Parameters:
isolationLevel - the isolation level to set
void setNetworkConnectionInfo(NetworkConnectionInfo networkConnectionInfo)
Sets the network connection information if possible.
void setNetworkConnectionInfo(NetworkConnectionInfo networkConnectionInfo)
Sets the network connection information if possible.
Parameters:
networkConnectionInfo - the network connection information
void setPowerOffCount(int i)
Set the number of disk operations before power failure is simulated.
void setPowerOffCount(int i)
Set the number of disk operations before power failure is simulated. To disable the countdown, use 0.
Parameters:
i - the number of operations