public interface Session
extends java.lang.AutoCloseable
The session object is NOT thread-safe. Do not invoke multiple operations on a single session using more than one thread. Behavior is not defined if this happens.
To create a session object, call
Connection.createSession.
A program that creates a session must explicitly call
Session.close to reclaim its resources.
This interface is implemented internally. Applications do not implement this interface.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TIBDG_SESSION_PROPERTY_BOOLEAN_TRANSACTED
Property name for a transacted session; boolean.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Destroy a session.
|
void |
commit()
Commit the current transaction on this session and begin a new
transaction.
|
Statement |
createStatement(java.lang.String sql,
java.util.Properties props)
Create a SQL statement obect.
|
long |
executeUpdate(java.lang.String sqlString,
java.util.Properties props)
Execute a SQL Update
|
Connection |
getConnection()
Get the connection object that was used to create the session.
|
Table |
openTable(java.lang.String name,
java.util.Properties props)
Open a table in the data grid.
|
void |
rollback()
Rollback a transaction on this session.
|
static final java.lang.String TIBDG_SESSION_PROPERTY_BOOLEAN_TRANSACTED
When creating a session,
supply this property to Connection.createSession.
The value true specifies that the created session will be transacted.
Table openTable(java.lang.String name, java.util.Properties props) throws DataGridException
name - The name of the table to be opened. This table must already be defined in the data grid.props - Optional, null to omitTableDataGridException - in case of failuresvoid commit()
throws DataGridException
Committing a transaction causes the data grid to make permanent all table operations performed since the start of the current transaction.
DataGridException - in case of failuresvoid rollback()
throws DataGridException
Rolling back a transaction causes the data grid to discard all table operations performed since the start of the transaction.
DataGridException - in case of failuresConnection getConnection() throws DataGridException
ConnectionDataGridException - in case of failuresStatement createStatement(java.lang.String sql, java.util.Properties props) throws DataGridException
sql - The sql string used to create the statement.props - Optional, null to omit
StatementDataGridException - in case of failureslong executeUpdate(java.lang.String sqlString,
java.util.Properties props)
throws DataGridException
A SQL update can be Create Table, Create Index, Drop Table, or Drop Index
sqlString - The sql string representing the update to executeprops - Optional. \c null to omit.DataGridException - in case of failuresvoid close()
throws DataGridException
If a transaction was started on this session, this call automatically rolls back the transaction.
close in interface java.lang.AutoCloseableDataGridException - in case of failures