public abstract class Session extends java.lang.Object implements CastDataProvider, java.lang.AutoCloseable
Modifier and Type | Class and Description |
---|---|
static class |
Session.DynamicSettings
Dynamic settings.
|
static class |
Session.StaticSettings
Static settings.
|
Modifier and Type | Method and Description |
---|---|
abstract org.h2.value.ValueLob |
addTemporaryLob(org.h2.value.ValueLob v)
Add a temporary LOB, which is closed when the session commits.
|
abstract void |
cancel()
Cancel the current or next command (called when closing a connection).
|
abstract void |
close()
Roll back pending transactions and close the session.
|
abstract boolean |
getAutoCommit()
Check if this session is in auto-commit mode.
|
abstract java.util.ArrayList<java.lang.String> |
getClusterServers()
Get the list of the cluster servers for this session.
|
abstract java.lang.String |
getCurrentSchemaName()
Get current schema.
|
abstract org.h2.jdbc.meta.DatabaseMeta |
getDatabaseMeta()
Returns database meta information.
|
abstract org.h2.store.DataHandler |
getDataHandler()
Get the data handler object.
|
abstract Session.DynamicSettings |
getDynamicSettings()
Returns dynamic settings.
|
abstract IsolationLevel |
getIsolationLevel()
Returns the isolation level.
|
abstract Session.StaticSettings |
getStaticSettings()
Returns static settings.
|
abstract org.h2.message.Trace |
getTrace()
Get the trace object
|
abstract boolean |
hasPendingTransaction()
Check whether this session has a pending transaction.
|
abstract boolean |
isClosed()
Check if close was called.
|
boolean |
isLockedByCurrentThread()
Returns whether this session is locked by the current thread.
|
abstract boolean |
isOldInformationSchema()
Returns whether INFORMATION_SCHEMA contains old-style tables.
|
abstract boolean |
isRemote()
Check if this session is remote or embedded.
|
void |
lock()
Locks this session with a reentrant lock.
|
abstract org.h2.command.CommandInterface |
prepareCommand(java.lang.String sql,
int fetchSize)
Parse a command and prepare it for execution.
|
void |
readSessionState()
Read the session state if necessary.
|
void |
resetThreadLocalSession(Session oldSession)
Resets old thread local session.
|
abstract void |
setAutoCommit(boolean autoCommit)
Set the auto-commit mode.
|
abstract void |
setCurrentSchemaName(java.lang.String schema)
Set current schema.
|
abstract void |
setIsolationLevel(IsolationLevel isolationLevel)
Sets the isolation level.
|
abstract void |
setNetworkConnectionInfo(org.h2.util.NetworkConnectionInfo networkConnectionInfo)
Sets the network connection information if possible.
|
Session |
setThreadLocalSession()
Sets this session as thread local session, if this session is a local
session.
|
void |
unlock()
Unlocks this session.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
currentTimestamp, currentTimeZone, getJavaObjectSerializer, getMode, zeroBasedEnums
public final void lock()
final Session session = ...; session.lock(); try { ... } finally { session.unlock(); }
public final void unlock()
lock()
public final boolean isLockedByCurrentThread()
true
if it locked by the current thread, false
if
it is locked by another thread or is not locked at allpublic abstract java.util.ArrayList<java.lang.String> getClusterServers()
public abstract org.h2.command.CommandInterface prepareCommand(java.lang.String sql, int fetchSize)
sql
- the SQL statementfetchSize
- the number of rows to fetch in one steppublic abstract void close()
close
in interface java.lang.AutoCloseable
public abstract org.h2.message.Trace getTrace()
public abstract boolean isClosed()
public abstract org.h2.store.DataHandler getDataHandler()
public abstract boolean hasPendingTransaction()
public abstract void cancel()
public abstract boolean getAutoCommit()
public abstract void setAutoCommit(boolean autoCommit)
autoCommit
- the new valuepublic abstract org.h2.value.ValueLob addTemporaryLob(org.h2.value.ValueLob v)
v
- the valuepublic abstract boolean isRemote()
public abstract void setCurrentSchemaName(java.lang.String schema)
schema
- the schema namepublic abstract java.lang.String getCurrentSchemaName()
public abstract void setNetworkConnectionInfo(org.h2.util.NetworkConnectionInfo networkConnectionInfo)
networkConnectionInfo
- the network connection informationpublic abstract IsolationLevel getIsolationLevel()
public abstract void setIsolationLevel(IsolationLevel isolationLevel)
isolationLevel
- the isolation level to setpublic abstract Session.StaticSettings getStaticSettings()
public abstract Session.DynamicSettings getDynamicSettings()
public abstract org.h2.jdbc.meta.DatabaseMeta getDatabaseMeta()
public abstract boolean isOldInformationSchema()
public void readSessionState()
public Session setThreadLocalSession()
null
public void resetThreadLocalSession(Session oldSession)
oldSession
- the old thread local session, or null