org.h2.engine

## Class SessionLocal

- java.lang.Object
- - org.h2.engine.Session
  - - org.h2.engine.SessionLocal

All Implemented Interfaces:
  java.lang.AutoCloseable, CastDataProvider, TransactionStore.RollbackListener

    public final class SessionLocal
    extends Session
    implements TransactionStore.RollbackListener

A session represents an embedded database connection. When using the server mode, this object resides on the server side and communicates with a SessionRemote object on the client side.

### Nested Class Summary

Nested Classes
`static class` `SessionLocal.Savepoint` Represents a savepoint (a position in a transaction to where one can roll back to).
`static class` `SessionLocal.State`
`static class` `SessionLocal.TimeoutValue` An LOB object with a timeout.

### Nested classes/interfaces inherited from class org.h2.engine.Session

`Session.DynamicSettings, Session.StaticSettings`

### Constructor Summary

Constructors
Constructor and Description
`SessionLocal(Database database, User user, int id)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addLocalTempTable(Table table)` Add a local temporary table to this session.
`void` `addLocalTempTableConstraint(Constraint constraint)` Add a local temporary constraint to this session.
`void` `addLocalTempTableIndex(Index index)` Add a local temporary index to this session.
`void` `addProcedure(Procedure procedure)` Add a procedure to this session.
`void` `addSavepoint(java.lang.String name)` Create a savepoint that is linked to the current log position.
`ValueLob` `addTemporaryLob(ValueLob v)` Add a temporary LOB, which is closed when the session commits.
`void` `addTemporaryResult(ResultInterface result)` Remember the result set and close it as soon as the transaction is committed (if it needs to be closed).
`boolean` `areEqual(Value a, Value b)` Check if two values are equal with the current comparison mode.
`void` `begin()` Begin a transaction.
`void` `cancel()` Cancel the current or next command (called when closing a connection).
`void` `checkCanceled()` Check if the current transaction is canceled by calling Statement.cancel() or because a session timeout was set and expired.
`void` `clearViewIndexCache()` Clear the view cache for this session.
`void` `close()` Roll back pending transactions and close the session.
`void` `commit(boolean ddl)` Commit the current transaction.
`int` `compare(Value a, Value b)` Compare two values with the current comparison mode.
`int` `compareTypeSafe(Value a, Value b)` Compare two values with the current comparison mode.
`int` `compareWithNull(Value a, Value b, boolean forEquality)` Compare two values with the current comparison mode.
`boolean` `containsUncommitted()` Whether the session contains any uncommitted changes.
`JdbcConnection` `createConnection(boolean columnList)` Create an internal connection.
`ValueTimestampTimeZone` `currentTimestamp()` Returns the current timestamp with maximum resolution.
`TimeZoneProvider` `currentTimeZone()` Returns the current time zone.
`void` `endStatement()` Mark the statement as completed.
`Table` `findLocalTempTable(java.lang.String name)` Get the local temporary table if one exists with that name, or null if not.
`Constraint` `findLocalTempTableConstraint(java.lang.String name)` Get the local temporary constraint if one exists with that name, or null if not.
`Index` `findLocalTempTableIndex(java.lang.String name)` Get the local temporary index if one exists with that name, or null if not.
`boolean` `getAllowLiterals()`
`boolean` `getAutoCommit()` Check if this session is in auto-commit mode.
`int` `getBlockingSessionId()`
`long` `getCancel()` Get the cancel time.
`java.util.ArrayList<java.lang.String>` `getClusterServers()` Get the list of the cluster servers for this session.
`ValueTimestampTimeZone` `getCommandStartOrEnd()`
`Command` `getCurrentCommand()`
`java.lang.String` `getCurrentSchemaName()` Get current schema.
`Value` `getCurrentValueFor(Sequence sequence)` Returns the current value of the sequence in this session.
`Database` `getDatabase()`
`DatabaseMeta` `getDatabaseMeta()` Returns database meta information.
`DataHandler` `getDataHandler()` Get the data handler object.
`Session.DynamicSettings` `getDynamicSettings()` Returns dynamic settings.
`int` `getId()`
`IsolationLevel` `getIsolationLevel()` Returns the isolation level.
`JavaObjectSerializer` `getJavaObjectSerializer()` Returns the custom Java object serializer, or `null`.
`Value` `getLastIdentity()`
`java.util.HashMap<java.lang.String,Constraint>` `getLocalTempTableConstraints()` Get the map of constraints for all constraints on local, temporary tables, if any.
`java.util.HashMap<java.lang.String,Index>` `getLocalTempTableIndexes()`
`java.util.List<Table>` `getLocalTempTables()`
`java.util.Set<Table>` `getLocks()`
`int` `getLockTimeout()`
`Mode` `getMode()` Returns the database mode.
`int` `getModificationId()`
`NetworkConnectionInfo` `getNetworkConnectionInfo()` Returns the network connection information, or `null`.
`java.lang.String` `getNextSystemIdentifier(java.lang.String sql)` Get the next system generated identifiers.
`Value` `getNextValueFor(Sequence sequence, Prepared prepared)` Returns the next value of the sequence in this session.
`java.util.BitSet` `getNonKeywords()` Gets bit set of non-keywords.
`Procedure` `getProcedure(java.lang.String name)` Get the procedure with the given name, or null if none exists.
`int` `getQueryTimeout()`
`java.util.Random` `getRandom()`
`java.lang.String[]` `getSchemaSearchPath()`
`ValueTimestampTimeZone` `getSessionStart()`
`long` `getSnapshotDataModificationId()` Returns the data modification id of transaction's snapshot, or 0 if isolation level doesn't use snapshots.
`SessionLocal.State` `getState()`
`Session.StaticSettings` `getStaticSettings()` Returns static settings.
`Trace` `getTrace()` Get the trace object
`Transaction` `getTransaction()` Get the transaction to use for this session.
`Value` `getTransactionId()`
`User` `getUser()`
`Value` `getVariable(java.lang.String name)` Get the value of the specified user defined variable.
`java.lang.String[]` `getVariableNames()` Get the list of variable names that are set for this session.
`java.util.Map<java.lang.Object,ViewIndex>` `getViewIndexCache(boolean subQuery)` Get the view cache for this session.
`Table` `getWaitForLock()`
`java.lang.Thread` `getWaitForLockThread()`
`int` `hashCode()`
`boolean` `hasPendingTransaction()` Check whether this session has a pending transaction.
`boolean` `hasPreparedTransaction()` Checks presence of prepared transaction in this session.
`boolean` `isClosed()` Check if close was called.
`boolean` `isForceJoinOrder()`
`boolean` `isLazyQueryExecution()`
`boolean` `isOldInformationSchema()` Returns whether INFORMATION_SCHEMA contains old-style tables.
`boolean` `isOpen()`
`boolean` `isParsingCreateView()`
`boolean` `isQuirksMode()` Returns whether quirks mode is enabled explicitly or implicitly.
`boolean` `isRemote()` Check if this session is remote or embedded.
`boolean` `isSupportsGeneratedKeys()` Returns is this session supports generated keys.
`boolean` `isTruncateLargeLength()` Returns parsing mode of data types with too large length.
`boolean` `isUndoLogEnabled()`
`boolean` `isVariableBinary()` Returns BINARY data type parsing mode.
`void` `markTableForAnalyze(Table table)` Mark that the given table needs to be analyzed on commit.
`int` `nextObjectId()` Get the next object id.
`void` `onRollback(MVMap<java.lang.Object,VersionedValue<java.lang.Object>> map, java.lang.Object key, VersionedValue<java.lang.Object> existingValue, VersionedValue<java.lang.Object> restoredValue)` Notified of a single map change (add/update/remove)
`Prepared` `prepare(java.lang.String sql)` Parse and prepare the given SQL statement.
`Prepared` `prepare(java.lang.String sql, boolean rightsChecked, boolean literalsChecked)` Parse and prepare the given SQL statement.
`CommandInterface` `prepareCommand(java.lang.String sql, int fetchSize)` Parse a command and prepare it for execution.
`void` `prepareCommit(java.lang.String transactionName)` Prepare the given transaction.
`Command` `prepareLocal(java.lang.String sql)` Parse and prepare the given SQL statement.
`void` `registerTableAsLocked(Table table)` Register table as locked within current transaction.
`void` `registerTableAsUpdated(Table table)` Register table as updated within current transaction.
`void` `removeAtCommit(ValueLob v)` Remember that the given LOB value must be removed at commit.
`void` `removeAtCommitStop(ValueLob v)` Do not remove this LOB value at commit any longer.
`void` `removeLocalTempTable(Table table)` Drop and remove the given local temporary table from this session.
`void` `removeLocalTempTableIndex(Index index)` Drop and remove the given local temporary index from this session.
`void` `removeProcedure(java.lang.String name)` Remove a procedure from this session.
`void` `rollback()` Fully roll back the current transaction.
`void` `rollbackTo(SessionLocal.Savepoint savepoint)` Partially roll back the current transaction.
`void` `rollbackToSavepoint(java.lang.String name)` Undo all operations back to the log position of the given savepoint.
`protected void` `scheduleDatabaseObjectIdForRelease(int id)` Arranges for the specified database object id to be released at the end of the current transaction.
`void` `setAllowLiterals(boolean b)`
`void` `setAutoCommit(boolean b)` Set the auto-commit mode.
`boolean` `setCommitOrRollbackDisabled(boolean x)`
`void` `setCurrentSchema(Schema schema)`
`void` `setCurrentSchemaName(java.lang.String schemaName)` Set current schema.
`void` `setForceJoinOrder(boolean forceJoinOrder)`
`void` `setIsolationLevel(IsolationLevel isolationLevel)` Sets the isolation level.
`void` `setLastIdentity(Value last)`
`void` `setLazyQueryExecution(boolean lazyQueryExecution)`
`void` `setLockTimeout(int lockTimeout)`
`void` `setNetworkConnectionInfo(NetworkConnectionInfo networkConnectionInfo)` Sets the network connection information if possible.
`void` `setNonKeywords(java.util.BitSet nonKeywords)` Sets bit set of non-keywords.
`void` `setOldInformationSchema(boolean oldInformationSchema)` Changes INFORMATION_SCHEMA content.
`void` `setParsingCreateView(boolean parsingView)` This method is called before and after parsing of view definition and may be called recursively.
`void` `setPreparedTransaction(java.lang.String transactionName, boolean commit)` Commit or roll back the given transaction.
`void` `setQueryTimeout(int queryTimeout)`
`void` `setQuirksMode(boolean quirksMode)` Enables or disables the quirks mode.
`SessionLocal.Savepoint` `setSavepoint()` Create a savepoint to allow rolling back to this state.
`void` `setSchemaSearchPath(java.lang.String[] schemas)`
`void` `setThrottle(int throttle)`
`void` `setTimeZone(TimeZoneProvider timeZone)` Sets current time zone.
`void` `setTruncateLargeLength(boolean truncateLargeLength)` Changes parsing mode of data types with too large length.
`void` `setUndoLogEnabled(boolean b)`
`void` `setVariable(java.lang.String name, Value value)` Set the value of the given variable for this session.
`void` `setVariableBinary(boolean variableBinary)` Changes parsing of a BINARY data type.
`void` `setWaitForLock(Table waitForLock, java.lang.Thread waitForLockThread)` Set the table this session is waiting for, and the thread that is waiting.
`void` `startStatementWithinTransaction(Command command)` Start a new statement within a transaction.
`void` `throttle()` Wait for some time if this session is throttled (slowed down).
`java.lang.String` `toString()`
`void` `waitIfExclusiveModeEnabled()` Wait if the exclusive mode has been enabled for another session.
`boolean` `zeroBasedEnums()` Returns are ENUM values 0-based.

### Methods inherited from class org.h2.engine.Session

`readSessionState`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### SessionLocal

    public SessionLocal(Database database,
                        User user,
                        int id)

### Method Detail

#### setLazyQueryExecution

    public void setLazyQueryExecution(boolean lazyQueryExecution)

#### isLazyQueryExecution

    public boolean isLazyQueryExecution()

#### setForceJoinOrder

    public void setForceJoinOrder(boolean forceJoinOrder)

#### isForceJoinOrder

    public boolean isForceJoinOrder()

#### setParsingCreateView

    public void setParsingCreateView(boolean parsingView)

This method is called before and after parsing of view definition and may be called recursively.

Parameters:
  `parsingView` - `true` if this method is called before parsing of view definition, `false` if it is called after it.

#### isParsingCreateView

    public boolean isParsingCreateView()

#### getClusterServers

    public java.util.ArrayList<java.lang.String> getClusterServers()

Description copied from class: `Session`
Get the list of the cluster servers for this session.

Specified by:
  `getClusterServers` in class `Session`
Returns:
  A list of "ip:port" strings for the cluster servers in this session.

#### setCommitOrRollbackDisabled

    public boolean setCommitOrRollbackDisabled(boolean x)

#### setVariable

    public void setVariable(java.lang.String name,
                            Value value)

Set the value of the given variable for this session.

Parameters:
  `name` - the name of the variable (may not be null)
  `value` - the new value (may not be null)

#### getVariable

    public Value getVariable(java.lang.String name)

Get the value of the specified user defined variable. This method always returns a value; it returns ValueNull.INSTANCE if the variable doesn't exist.

Parameters:
  `name` - the variable name
Returns:
  the value, or NULL

#### getVariableNames

    public java.lang.String[] getVariableNames()

Get the list of variable names that are set for this session.

Returns:
  the list of names

#### findLocalTempTable

    public Table findLocalTempTable(java.lang.String name)

Get the local temporary table if one exists with that name, or null if not.

Parameters:
  `name` - the table name
Returns:
  the table, or null

#### getLocalTempTables

    public java.util.List<Table> getLocalTempTables()

#### addLocalTempTable

    public void addLocalTempTable(Table table)

Add a local temporary table to this session.

Parameters:
  `table` - the table to add
Throws:
  `DbException` - if a table with this name already exists

#### removeLocalTempTable

    public void removeLocalTempTable(Table table)

Drop and remove the given local temporary table from this session.

Parameters:
  `table` - the table

#### findLocalTempTableIndex

    public Index findLocalTempTableIndex(java.lang.String name)

Get the local temporary index if one exists with that name, or null if not.

Parameters:
  `name` - the table name
Returns:
  the table, or null

#### getLocalTempTableIndexes

    public java.util.HashMap<java.lang.String,Index> getLocalTempTableIndexes()

#### addLocalTempTableIndex

    public void addLocalTempTableIndex(Index index)

Add a local temporary index to this session.

Parameters:
  `index` - the index to add
Throws:
  `DbException` - if a index with this name already exists

#### removeLocalTempTableIndex

    public void removeLocalTempTableIndex(Index index)

Drop and remove the given local temporary index from this session.

Parameters:
  `index` - the index

#### findLocalTempTableConstraint

    public Constraint findLocalTempTableConstraint(java.lang.String name)

Get the local temporary constraint if one exists with that name, or null if not.

Parameters:
  `name` - the constraint name
Returns:
  the constraint, or null

#### getLocalTempTableConstraints

    public java.util.HashMap<java.lang.String,Constraint> getLocalTempTableConstraints()

Get the map of constraints for all constraints on local, temporary tables, if any. The map's keys are the constraints' names.

Returns:
  the map of constraints, or null

#### addLocalTempTableConstraint

    public void addLocalTempTableConstraint(Constraint constraint)

Add a local temporary constraint to this session.

Parameters:
  `constraint` - the constraint to add
Throws:
  `DbException` - if a constraint with the same name already exists

#### getAutoCommit

    public boolean getAutoCommit()

Description copied from class: `Session`
Check if this session is in auto-commit mode.

Specified by:
  `getAutoCommit` in class `Session`
Returns:
  true if the session is in auto-commit mode

#### getUser

    public User getUser()

#### setAutoCommit

    public void setAutoCommit(boolean b)

Description copied from class: `Session`
Set the auto-commit mode. This call doesn't commit the current transaction.

Specified by:
  `setAutoCommit` in class `Session`
Parameters:
  `b` - the new value

#### getLockTimeout

    public int getLockTimeout()

#### setLockTimeout

    public void setLockTimeout(int lockTimeout)

#### prepareCommand

    public CommandInterface prepareCommand(java.lang.String sql,
                                           int fetchSize)

Description copied from class: `Session`
Parse a command and prepare it for execution.

Specified by:
  `prepareCommand` in class `Session`
Parameters:
  `sql` - the SQL statement
  `fetchSize` - the number of rows to fetch in one step
Returns:
  the prepared command

#### prepare

    public Prepared prepare(java.lang.String sql)

Parse and prepare the given SQL statement. This method also checks the rights.

Parameters:
  `sql` - the SQL statement
Returns:
  the prepared statement

#### prepare

    public Prepared prepare(java.lang.String sql,
                            boolean rightsChecked,
                            boolean literalsChecked)

Parse and prepare the given SQL statement.

Parameters:
  `sql` - the SQL statement
  `rightsChecked` - true if the rights have already been checked
  `literalsChecked` - true if the sql string has already been checked for literals (only used if ALLOW_LITERALS NONE is set).
Returns:
  the prepared statement

#### prepareLocal

    public Command prepareLocal(java.lang.String sql)

Parse and prepare the given SQL statement. This method also checks if the connection has been closed.

Parameters:
  `sql` - the SQL statement
Returns:
  the prepared statement

#### scheduleDatabaseObjectIdForRelease

    protected void scheduleDatabaseObjectIdForRelease(int id)

Arranges for the specified database object id to be released at the end of the current transaction.

Parameters:
  `id` - to be scheduled

#### getDatabase

    public Database getDatabase()

#### commit

    public void commit(boolean ddl)

Commit the current transaction. If the statement was not a data definition statement, and if there are temporary tables that should be dropped or truncated at commit, this is done as well.

Parameters:
  `ddl` - if the statement was a data definition statement

#### getSnapshotDataModificationId

    public long getSnapshotDataModificationId()

Returns the data modification id of transaction's snapshot, or 0 if isolation level doesn't use snapshots.

Returns:
  the data modification id of transaction's snapshot, or 0

#### rollback

    public void rollback()

Fully roll back the current transaction.

#### rollbackTo

    public void rollbackTo(SessionLocal.Savepoint savepoint)

Partially roll back the current transaction.

Parameters:
  `savepoint` - the savepoint to which should be rolled back

#### hasPendingTransaction

    public boolean hasPendingTransaction()

Description copied from class: `Session`
Check whether this session has a pending transaction.

Specified by:
  `hasPendingTransaction` in class `Session`
Returns:
  true if it has

#### setSavepoint

    public SessionLocal.Savepoint setSavepoint()

Create a savepoint to allow rolling back to this state.

Returns:
  the savepoint

#### getId

    public int getId()

#### cancel

    public void cancel()

Description copied from class: `Session`
Cancel the current or next command (called when closing a connection).

Specified by:
  `cancel` in class `Session`

#### close

    public void close()

Description copied from class: `Session`
Roll back pending transactions and close the session.

Specified by:
  `close` in interface `java.lang.AutoCloseable`
Specified by:
  `close` in class `Session`

#### registerTableAsLocked

    public void registerTableAsLocked(Table table)

Register table as locked within current transaction. Table is unlocked on commit or rollback. It also assumes that table will be modified by transaction.

Parameters:
  `table` - the table that is locked

#### registerTableAsUpdated

    public void registerTableAsUpdated(Table table)

Register table as updated within current transaction. This is used instead of table locking when lock mode is LOCK_MODE_OFF.

Parameters:
  `table` - to register

#### getRandom

    public java.util.Random getRandom()

#### getTrace

    public Trace getTrace()

Description copied from class: `Session`
Get the trace object

Specified by:
  `getTrace` in class `Session`
Returns:
  the trace object

#### getNextValueFor

    public Value getNextValueFor(Sequence sequence,
                                 Prepared prepared)

Returns the next value of the sequence in this session.

Parameters:
  `sequence` - the sequence
  `prepared` - current prepared command, select, or `null`
Returns:
  the next value of the sequence in this session

#### getCurrentValueFor

    public Value getCurrentValueFor(Sequence sequence)

Returns the current value of the sequence in this session.

Parameters:
  `sequence` - the sequence
Returns:
  the current value of the sequence in this session
Throws:
  `DbException` - if current value is not defined

#### setLastIdentity

    public void setLastIdentity(Value last)

#### getLastIdentity

    public Value getLastIdentity()

#### containsUncommitted

    public boolean containsUncommitted()

Whether the session contains any uncommitted changes.

Returns:
  true if yes

#### addSavepoint

    public void addSavepoint(java.lang.String name)

Create a savepoint that is linked to the current log position.

Parameters:
  `name` - the savepoint name

#### rollbackToSavepoint

    public void rollbackToSavepoint(java.lang.String name)

Undo all operations back to the log position of the given savepoint.

Parameters:
  `name` - the savepoint name

#### prepareCommit

    public void prepareCommit(java.lang.String transactionName)

Prepare the given transaction.

Parameters:
  `transactionName` - the name of the transaction

#### hasPreparedTransaction

    public boolean hasPreparedTransaction()

Checks presence of prepared transaction in this session.

Returns:
  `true` if there is a prepared transaction, `false` otherwise

#### setPreparedTransaction

    public void setPreparedTransaction(java.lang.String transactionName,
                                       boolean commit)

Commit or roll back the given transaction.

Parameters:
  `transactionName` - the name of the transaction
  `commit` - true for commit, false for rollback

#### isClosed

    public boolean isClosed()

Description copied from class: `Session`
Check if close was called.

Specified by:
  `isClosed` in class `Session`
Returns:
  if the session has been closed

#### isOpen

    public boolean isOpen()

#### setThrottle

    public void setThrottle(int throttle)

#### throttle

    public void throttle()

Wait for some time if this session is throttled (slowed down).

#### checkCanceled

    public void checkCanceled()

Check if the current transaction is canceled by calling Statement.cancel() or because a session timeout was set and expired.

Throws:
  `DbException` - if the transaction is canceled

#### getCancel

    public long getCancel()

Get the cancel time.

Returns:
  the time or 0 if not set

#### getCurrentCommand

    public Command getCurrentCommand()

#### getCommandStartOrEnd

    public ValueTimestampTimeZone getCommandStartOrEnd()

#### getAllowLiterals

    public boolean getAllowLiterals()

#### setAllowLiterals

    public void setAllowLiterals(boolean b)

#### setCurrentSchema

    public void setCurrentSchema(Schema schema)

#### getCurrentSchemaName

    public java.lang.String getCurrentSchemaName()

Description copied from class: `Session`
Get current schema.

Specified by:
  `getCurrentSchemaName` in class `Session`
Returns:
  the current schema name

#### setCurrentSchemaName

    public void setCurrentSchemaName(java.lang.String schemaName)

Description copied from class: `Session`
Set current schema.

Specified by:
  `setCurrentSchemaName` in class `Session`
Parameters:
  `schemaName` - the schema name

#### createConnection

    public JdbcConnection createConnection(boolean columnList)

Create an internal connection. This connection is used when initializing triggers, and when calling user defined functions.

Parameters:
  `columnList` - if the url should be 'jdbc:columnlist:connection'
Returns:
  the internal connection

#### getDataHandler

    public DataHandler getDataHandler()

Description copied from class: `Session`
Get the data handler object.

Specified by:
  `getDataHandler` in class `Session`
Returns:
  the data handler

#### removeAtCommit

    public void removeAtCommit(ValueLob v)

Remember that the given LOB value must be removed at commit.

Parameters:
  `v` - the value

#### removeAtCommitStop

    public void removeAtCommitStop(ValueLob v)

Do not remove this LOB value at commit any longer.

Parameters:
  `v` - the value

#### getNextSystemIdentifier

    public java.lang.String getNextSystemIdentifier(java.lang.String sql)

Get the next system generated identifiers. The identifier returned does not occur within the given SQL statement.

Parameters:
  `sql` - the SQL statement
Returns:
  the new identifier

#### addProcedure

    public void addProcedure(Procedure procedure)

Add a procedure to this session.

Parameters:
  `procedure` - the procedure to add

#### removeProcedure

    public void removeProcedure(java.lang.String name)

Remove a procedure from this session.

Parameters:
  `name` - the name of the procedure to remove

#### getProcedure

    public Procedure getProcedure(java.lang.String name)

Get the procedure with the given name, or null if none exists.

Parameters:
  `name` - the procedure name
Returns:
  the procedure or null

#### setSchemaSearchPath

    public void setSchemaSearchPath(java.lang.String[] schemas)

#### getSchemaSearchPath

    public java.lang.String[] getSchemaSearchPath()

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `java.lang.Object`

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`

#### setUndoLogEnabled

    public void setUndoLogEnabled(boolean b)

#### isUndoLogEnabled

    public boolean isUndoLogEnabled()

#### begin

    public void begin()

Begin a transaction.

#### getSessionStart

    public ValueTimestampTimeZone getSessionStart()

#### getLocks

    public java.util.Set<Table> getLocks()

#### waitIfExclusiveModeEnabled

    public void waitIfExclusiveModeEnabled()

Wait if the exclusive mode has been enabled for another session. This method returns as soon as the exclusive mode has been disabled.

#### getViewIndexCache

    public java.util.Map<java.lang.Object,ViewIndex> getViewIndexCache(boolean subQuery)

Get the view cache for this session. There are two caches: the subquery cache (which is only use for a single query, has no bounds, and is cleared after use), and the cache for regular views.

Parameters:
  `subQuery` - true to get the subquery cache
Returns:
  the view cache

#### addTemporaryResult

    public void addTemporaryResult(ResultInterface result)

Remember the result set and close it as soon as the transaction is committed (if it needs to be closed). This is done to delete temporary files as soon as possible, and free object ids of temporary tables.

Parameters:
  `result` - the temporary result set

#### setQueryTimeout

    public void setQueryTimeout(int queryTimeout)

#### getQueryTimeout

    public int getQueryTimeout()

#### setWaitForLock

    public void setWaitForLock(Table waitForLock,
                               java.lang.Thread waitForLockThread)

Set the table this session is waiting for, and the thread that is waiting.

Parameters:
  `waitForLock` - the table
  `waitForLockThread` - the current thread (the one that is waiting)

#### getWaitForLock

    public Table getWaitForLock()

#### getWaitForLockThread

    public java.lang.Thread getWaitForLockThread()

#### getModificationId

    public int getModificationId()

#### getTransactionId

    public Value getTransactionId()

#### nextObjectId

    public int nextObjectId()

Get the next object id.

Returns:
  the next object id

#### getTransaction

    public Transaction getTransaction()

Get the transaction to use for this session.

Returns:
  the transaction

#### startStatementWithinTransaction

    public void startStatementWithinTransaction(Command command)

Start a new statement within a transaction.

Parameters:
  `command` - about to be started

#### endStatement

    public void endStatement()

Mark the statement as completed. This also close all temporary result set, and deletes all temporary files held by the result sets.

#### clearViewIndexCache

    public void clearViewIndexCache()

Clear the view cache for this session.

#### addTemporaryLob

    public ValueLob addTemporaryLob(ValueLob v)

Description copied from class: `Session`
Add a temporary LOB, which is closed when the session commits.

Specified by:
  `addTemporaryLob` in class `Session`
Parameters:
  `v` - the value
Returns:
  the specified value

#### isRemote

    public boolean isRemote()

Description copied from class: `Session`
Check if this session is remote or embedded.

Specified by:
  `isRemote` in class `Session`
Returns:
  true if this session is remote

#### markTableForAnalyze

    public void markTableForAnalyze(Table table)

Mark that the given table needs to be analyzed on commit.

Parameters:
  `table` - the table

#### getState

    public SessionLocal.State getState()

#### getBlockingSessionId

    public int getBlockingSessionId()

#### onRollback

    public void onRollback(MVMap<java.lang.Object,VersionedValue<java.lang.Object>> map,
                           java.lang.Object key,
                           VersionedValue<java.lang.Object> existingValue,
                           VersionedValue<java.lang.Object> restoredValue)

Description copied from interface: `TransactionStore.RollbackListener`
Notified of a single map change (add/update/remove)

Specified by:
  `onRollback` in interface `TransactionStore.RollbackListener`
Parameters:
  `map` - modified
  `key` - of the modified entry
  `existingValue` - value in the map (null if delete is rolled back)
  `restoredValue` - value to be restored (null if add is rolled back)

#### isSupportsGeneratedKeys

    public boolean isSupportsGeneratedKeys()

Description copied from class: `Session`
Returns is this session supports generated keys.

Specified by:
  `isSupportsGeneratedKeys` in class `Session`
Returns:
  `true` if generated keys are supported, `false` if only `SCOPE_IDENTITY()` is supported

#### getNetworkConnectionInfo

    public NetworkConnectionInfo getNetworkConnectionInfo()

Returns the network connection information, or `null`.

Returns:
  the network connection information, or `null`

#### setNetworkConnectionInfo

    public void setNetworkConnectionInfo(NetworkConnectionInfo networkConnectionInfo)

Description copied from class: `Session`
Sets the network connection information if possible.

Specified by:
  `setNetworkConnectionInfo` in class `Session`
Parameters:
  `networkConnectionInfo` - the network connection information

#### currentTimestamp

    public ValueTimestampTimeZone currentTimestamp()

Description copied from interface: `CastDataProvider`
Returns the current timestamp with maximum resolution. The value must be the same within a transaction or within execution of a command.

Specified by:
  `currentTimestamp` in interface `CastDataProvider`
Returns:
  the current timestamp for CURRENT_TIMESTAMP(9)

#### getMode

    public Mode getMode()

Description copied from interface: `CastDataProvider`
Returns the database mode.

Specified by:
  `getMode` in interface `CastDataProvider`
Returns:
  the database mode

#### getJavaObjectSerializer

    public JavaObjectSerializer getJavaObjectSerializer()

Description copied from interface: `CastDataProvider`
Returns the custom Java object serializer, or `null`.

Specified by:
  `getJavaObjectSerializer` in interface `CastDataProvider`
Returns:
  the custom Java object serializer, or `null`

#### getIsolationLevel

    public IsolationLevel getIsolationLevel()

Description copied from class: `Session`
Returns the isolation level.

Specified by:
  `getIsolationLevel` in class `Session`
Returns:
  the isolation level

#### setIsolationLevel

    public void setIsolationLevel(IsolationLevel isolationLevel)

Description copied from class: `Session`
Sets the isolation level.

Specified by:
  `setIsolationLevel` in class `Session`
Parameters:
  `isolationLevel` - the isolation level to set

#### getNonKeywords

    public java.util.BitSet getNonKeywords()

Gets bit set of non-keywords.

Returns:
  set of non-keywords, or `null`

#### setNonKeywords

    public void setNonKeywords(java.util.BitSet nonKeywords)

Sets bit set of non-keywords.

Parameters:
  `nonKeywords` - set of non-keywords, or `null`

#### getStaticSettings

    public Session.StaticSettings getStaticSettings()

Description copied from class: `Session`
Returns static settings. These settings cannot be changed during lifecycle of session.

Specified by:
  `getStaticSettings` in class `Session`
Returns:
  static settings

#### getDynamicSettings

    public Session.DynamicSettings getDynamicSettings()

Description copied from class: `Session`
Returns dynamic settings. These settings can be changed during lifecycle of session.

Specified by:
  `getDynamicSettings` in class `Session`
Returns:
  dynamic settings

#### currentTimeZone

    public TimeZoneProvider currentTimeZone()

Description copied from interface: `CastDataProvider`
Returns the current time zone.

Specified by:
  `currentTimeZone` in interface `CastDataProvider`
Returns:
  the current time zone

#### setTimeZone

    public void setTimeZone(TimeZoneProvider timeZone)

Sets current time zone.

Parameters:
  `timeZone` - time zone

#### areEqual

    public boolean areEqual(Value a,
                            Value b)

Check if two values are equal with the current comparison mode.

Parameters:
  `a` - the first value
  `b` - the second value
Returns:
  true if both objects are equal

#### compare

    public int compare(Value a,
                       Value b)

Compare two values with the current comparison mode. The values may have different data types including NULL.

Parameters:
  `a` - the first value
  `b` - the second value
Returns:
  0 if both values are equal, -1 if the first value is smaller, and 1 otherwise

#### compareWithNull

    public int compareWithNull(Value a,
                               Value b,
                               boolean forEquality)

Compare two values with the current comparison mode. The values may have different data types including NULL.

Parameters:
  `a` - the first value
  `b` - the second value
  `forEquality` - perform only check for equality (= or <>)
Returns:
  0 if both values are equal, -1 if the first value is smaller, 1 if the second value is larger, `Integer.MIN_VALUE` if order is not defined due to NULL comparison

#### compareTypeSafe

    public int compareTypeSafe(Value a,
                               Value b)

Compare two values with the current comparison mode. The values must be of the same type.

Parameters:
  `a` - the first value
  `b` - the second value
Returns:
  0 if both values are equal, -1 if the first value is smaller, and 1 otherwise

#### setTruncateLargeLength

    public void setTruncateLargeLength(boolean truncateLargeLength)

Changes parsing mode of data types with too large length.

Parameters:
  `truncateLargeLength` - `true` to truncate to valid bound, `false` to throw an exception

#### isTruncateLargeLength

    public boolean isTruncateLargeLength()

Returns parsing mode of data types with too large length.

Returns:
  `true` if large length is truncated, `false` if an exception is thrown

#### setVariableBinary

    public void setVariableBinary(boolean variableBinary)

Changes parsing of a BINARY data type.

Parameters:
  `variableBinary` - `true` to parse BINARY as VARBINARY, `false` to parse it as is

#### isVariableBinary

    public boolean isVariableBinary()

Returns BINARY data type parsing mode.

Returns:
  `true` if BINARY should be parsed as VARBINARY, `false` if it should be parsed as is

#### setOldInformationSchema

    public void setOldInformationSchema(boolean oldInformationSchema)

Changes INFORMATION_SCHEMA content.

Parameters:
  `oldInformationSchema` - `true` to have old-style tables in INFORMATION_SCHEMA, `false` to have modern tables

#### isOldInformationSchema

    public boolean isOldInformationSchema()

Description copied from class: `Session`
Returns whether INFORMATION_SCHEMA contains old-style tables.

Specified by:
  `isOldInformationSchema` in class `Session`
Returns:
  whether INFORMATION_SCHEMA contains old-style tables

#### getDatabaseMeta

    public DatabaseMeta getDatabaseMeta()

Description copied from class: `Session`
Returns database meta information.

Specified by:
  `getDatabaseMeta` in class `Session`
Returns:
  database meta information

#### zeroBasedEnums

    public boolean zeroBasedEnums()

Description copied from interface: `CastDataProvider`
Returns are ENUM values 0-based.

Specified by:
  `zeroBasedEnums` in interface `CastDataProvider`
Returns:
  are ENUM values 0-based

#### setQuirksMode

    public void setQuirksMode(boolean quirksMode)

Enables or disables the quirks mode.

Parameters:
  `quirksMode` - whether quirks mode should be enabled

#### isQuirksMode

    public boolean isQuirksMode()

Returns whether quirks mode is enabled explicitly or implicitly.

Returns:
  `true` if database is starting or quirks mode was enabled explicitly, `false` otherwise