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.
|
static java.lang.String |
TIBDG_SESSION_PROPERTY_STRING_CHECKPOINT_NAME
Property name for specifying checkpoint used in a session; string.
|
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 object.
|
BatchResult |
deleteRows(Row[] rows,
java.util.Properties properties)
DELETE a batch of rows from the datagrid
|
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.
|
BatchResult |
getRows(Row[] rows,
java.util.Properties properties)
GET a batch of rows from the datagrid
|
Table |
openTable(java.lang.String name,
java.util.Properties props)
Open a table in the data grid.
|
BatchResult |
putRows(Row[] rows,
java.util.Properties properties)
PUT a batch of rows from the datagrid
|
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.
static final java.lang.String TIBDG_SESSION_PROPERTY_STRING_CHECKPOINT_NAME
Supply this property to Connection.createSession
.
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 omitTable
DataGridException
- 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
Connection
DataGridException
- 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
Statement
DataGridException
- 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 failuresBatchResult getRows(Row[] rows, java.util.Properties properties) throws DataGridException
Note: the rows may be on different tables. Not valid for transacted sessions
rows
- The array of rows to GETproperties
- Optional, null to omitBatchResult
DataGridException
- in case of failuresBatchResult putRows(Row[] rows, java.util.Properties properties) throws DataGridException
Note: the rows may be on different tables. Not valid for transacted sessions
rows
- The array of rows to PUTproperties
- Optional, null to omitBatchResult
DataGridException
- in case of failuresBatchResult deleteRows(Row[] rows, java.util.Properties properties) throws DataGridException
Note: the rows may be on different tables. Not valid for transacted sessions
rows
- The array of rows to DELETEproperties
- Optional, null to omitBatchResult
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.AutoCloseable
DataGridException
- in case of failures