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 should explicitly call
Session.close to reclaim its resources.
Since Version 4.10: Whenever a Session that did not have its
Session.close method called is garbage collected, the
native resources will be reclaimed automatically. This behavior is controlled by the
com.tibco.tibdg.autoclose System Property. If the property is not set or set to "cleanup"
(the default), the native resources will be reclaimed as if the
Session.close method had been called. If the System Property is
set to "warn", a warning will be printed to stderr instead of doing the cleanup.
If the property is set to "inactive", this feature will not be activated.
This interface is implemented internally. Applications do not implement this interface.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TIBDG_SESSION_CHECKPOINT_NAME_LATEST
A special checkpoint name that refers to the latest successful checkpoint
Specifying this as the value for
Session.TIBDG_SESSION_PROPERTY_STRING_CHECKPOINT_NAME
property instructs the proxy to replace with the last successful checkpoint name. |
static java.lang.String |
TIBDG_SESSION_PROPERTY_BOOLEAN_IMMUTABLE_ROWS
Property to specify immutability of rows returned from ResultSet/Get APIs.
|
static java.lang.String |
TIBDG_SESSION_PROPERTY_BOOLEAN_TRANSACTED
Property name for a transacted session; boolean.
|
static java.lang.String |
TIBDG_SESSION_PROPERTY_DOUBLE_TRANSACTION_TIMEOUT
Property name for specifying the per-session transaction activity timeout.
|
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
|
void |
interrupt()
Interrupt interrupts any outstanding request on the Session forcing it to throw an
interrupted exception (
InterruptedException). |
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.
|
BatchResult |
updateRows(Row[] rows,
java.util.Properties properties)
UPDATE a batch of rows from the datagrid
|
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.
static final java.lang.String TIBDG_SESSION_PROPERTY_DOUBLE_TRANSACTION_TIMEOUT
static final java.lang.String TIBDG_SESSION_CHECKPOINT_NAME_LATEST
Session.TIBDG_SESSION_PROPERTY_STRING_CHECKPOINT_NAME
property instructs the proxy to replace with the last successful checkpoint name.static final java.lang.String TIBDG_SESSION_PROPERTY_BOOLEAN_IMMUTABLE_ROWS
Supply this property to Connection.createSession.
Connection.TIBDG_CONNECTION_PROPERTY_BOOLEAN_IMMUTABLE_ROWS.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 omit
TableDataGridException - 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 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 omitBatchResultDataGridException - 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 omitBatchResultDataGridException - 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 omitBatchResultDataGridException - in case of failuresBatchResult updateRows(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 UPDATEproperties - Optional, null to omitBatchResultDataGridException - 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 failuresvoid interrupt()
throws DataGridException
InterruptedException).DataGridException - in case of failures