public final class SessionRemote extends Session implements org.h2.store.DataHandler
Session.DynamicSettings, Session.StaticSettings| Modifier and Type | Field and Description |
|---|---|
static int |
CHANGE_ID |
static int |
COMMAND_CLOSE |
static int |
COMMAND_COMMIT |
static int |
COMMAND_EXECUTE_QUERY |
static int |
COMMAND_EXECUTE_UPDATE |
static int |
COMMAND_GET_META_DATA |
static int |
GET_JDBC_META |
static int |
LOB_READ |
static int |
RESULT_CLOSE |
static int |
RESULT_FETCH_ROWS |
static int |
RESULT_RESET |
static int |
SESSION_CANCEL_STATEMENT |
static int |
SESSION_CHECK_KEY |
static int |
SESSION_CLOSE |
static int |
SESSION_HAS_PENDING_TRANSACTION |
static int |
SESSION_PREPARE |
static int |
SESSION_PREPARE_READ_PARAMS2 |
static int |
SESSION_SET_AUTOCOMMIT |
static int |
SESSION_SET_ID |
static int |
STATUS_CLOSED |
static int |
STATUS_ERROR |
static int |
STATUS_OK |
static int |
STATUS_OK_STATE_CHANGED |
| Constructor and Description |
|---|
SessionRemote(ConnectionInfo ci) |
| Modifier and Type | Method and Description |
|---|---|
org.h2.value.ValueLob |
addTemporaryLob(org.h2.value.ValueLob v)
Add a temporary LOB, which is closed when the session commits.
|
void |
autoCommitIfCluster()
Calls COMMIT if the session is in cluster mode.
|
void |
cancel()
Cancel the current or next command (called when closing a connection).
|
void |
cancelStatement(int id)
Cancel the statement with the given id.
|
void |
checkClosed()
Check if this session is closed and throws an exception if so.
|
void |
checkPowerOff()
Check if the simulated power failure occurred.
|
void |
checkWritingAllowed()
Check if writing is allowed.
|
void |
close()
Roll back pending transactions and close the session.
|
Session |
connectEmbeddedOrServer(boolean openNew)
Open a new (remote or embedded) session.
|
org.h2.value.ValueTimestampTimeZone |
currentTimestamp()
Returns the current timestamp with maximum resolution.
|
org.h2.util.TimeZoneProvider |
currentTimeZone()
Returns the current time zone.
|
void |
done(org.h2.value.Transfer transfer)
Called to flush the output after data has been sent to the server and
just before receiving data.
|
boolean |
getAutoCommit()
Check if this session is in auto-commit mode.
|
int |
getClientVersion()
Returns the TCP protocol version of remote connection.
|
java.util.ArrayList<java.lang.String> |
getClusterServers()
Get the list of the cluster servers for this session.
|
org.h2.value.CompareMode |
getCompareMode()
Return compare mode.
|
int |
getCurrentId() |
java.lang.String |
getCurrentSchemaName()
Get current schema.
|
org.h2.jdbc.meta.DatabaseMeta |
getDatabaseMeta()
Returns database meta information.
|
java.lang.String |
getDatabasePath()
Get the database path.
|
org.h2.store.DataHandler |
getDataHandler()
Get the data handler object.
|
Session.DynamicSettings |
getDynamicSettings()
Returns dynamic settings.
|
IsolationLevel |
getIsolationLevel()
Returns the isolation level.
|
JavaObjectSerializer |
getJavaObjectSerializer()
Returns the custom Java object serializer, or
null. |
int |
getLastReconnect() |
org.h2.util.SmallLRUCache<java.lang.String,java.lang.String[]> |
getLobFileListCache()
Get the lob file list cache if it is used.
|
org.h2.store.LobStorageFrontend |
getLobStorage()
Get the lob storage mechanism to use.
|
java.lang.Object |
getLobSyncObject()
Get the synchronization object for lob operations.
|
int |
getMaxLengthInplaceLob()
Get the maximum length of a in-place large object
|
Mode |
getMode()
Returns the database mode.
|
int |
getNextId() |
Session.StaticSettings |
getStaticSettings()
Returns static settings.
|
org.h2.util.TempFileDeleter |
getTempFileDeleter()
Get the temp file deleter mechanism.
|
org.h2.message.Trace |
getTrace()
Get the trace object
|
boolean |
hasPendingTransaction()
Check whether this session has a pending transaction.
|
boolean |
isClosed()
Check if close was called.
|
boolean |
isClustered()
Returns true if the connection was opened in cluster mode.
|
boolean |
isOldInformationSchema()
Returns whether INFORMATION_SCHEMA contains old-style tables.
|
boolean |
isRemote()
Check if this session is remote or embedded.
|
org.h2.store.FileStore |
openFile(java.lang.String name,
java.lang.String mode,
boolean mustExist)
Open a file at the given location.
|
org.h2.command.CommandInterface |
prepareCommand(java.lang.String sql,
int fetchSize)
Parse a command and prepare it for execution.
|
static org.h2.message.DbException |
readException(org.h2.value.Transfer transfer)
Reads an exception.
|
int |
readLob(long lobId,
byte[] hmac,
long offset,
byte[] buff,
int off,
int length)
Read from a lob.
|
void |
removeServer(java.io.IOException e,
int i,
int count)
Remove a server from the list of cluster nodes and disables the cluster
mode.
|
void |
setAutoCommit(boolean autoCommit)
Set the auto-commit mode.
|
void |
setAutoCommitFromServer(boolean autoCommit) |
void |
setCurrentSchemaName(java.lang.String schema)
Set current schema.
|
void |
setIsolationLevel(IsolationLevel isolationLevel)
Sets the isolation level.
|
void |
setNetworkConnectionInfo(org.h2.util.NetworkConnectionInfo networkConnectionInfo)
Sets the network connection information if possible.
|
void |
traceOperation(java.lang.String operation,
int id)
Write the operation to the trace system if debug trace is enabled.
|
boolean |
zeroBasedEnums()
Returns are ENUM values 0-based.
|
isLockedByCurrentThread, lock, readSessionState, resetThreadLocalSession, setThreadLocalSession, unlockpublic static final int SESSION_PREPARE
public static final int SESSION_CLOSE
public static final int COMMAND_EXECUTE_QUERY
public static final int COMMAND_EXECUTE_UPDATE
public static final int COMMAND_CLOSE
public static final int RESULT_FETCH_ROWS
public static final int RESULT_RESET
public static final int RESULT_CLOSE
public static final int COMMAND_COMMIT
public static final int CHANGE_ID
public static final int COMMAND_GET_META_DATA
public static final int SESSION_SET_ID
public static final int SESSION_CANCEL_STATEMENT
public static final int SESSION_CHECK_KEY
public static final int SESSION_SET_AUTOCOMMIT
public static final int SESSION_HAS_PENDING_TRANSACTION
public static final int LOB_READ
public static final int SESSION_PREPARE_READ_PARAMS2
public static final int GET_JDBC_META
public static final int STATUS_ERROR
public static final int STATUS_OK
public static final int STATUS_CLOSED
public static final int STATUS_OK_STATE_CHANGED
public SessionRemote(ConnectionInfo ci)
public java.util.ArrayList<java.lang.String> getClusterServers()
SessiongetClusterServers in class Sessionpublic boolean hasPendingTransaction()
SessionhasPendingTransaction in class Sessionpublic void cancel()
Sessionpublic void cancelStatement(int id)
id - the statement idpublic int getClientVersion()
public boolean getAutoCommit()
SessiongetAutoCommit in class Sessionpublic void setAutoCommit(boolean autoCommit)
SessionsetAutoCommit in class SessionautoCommit - the new valuepublic void setAutoCommitFromServer(boolean autoCommit)
public void autoCommitIfCluster()
public Session connectEmbeddedOrServer(boolean openNew)
openNew - whether to open a new session in any casepublic void removeServer(java.io.IOException e,
int i,
int count)
e - the exception (used for debugging)i - the index of the server to removecount - the retry count indexpublic org.h2.command.CommandInterface prepareCommand(java.lang.String sql,
int fetchSize)
SessionprepareCommand in class Sessionsql - the SQL statementfetchSize - the number of rows to fetch in one steppublic void checkClosed()
org.h2.message.DbException - if the session is closedpublic void close()
Sessionpublic org.h2.message.Trace getTrace()
Sessionpublic int getNextId()
public int getCurrentId()
public void done(org.h2.value.Transfer transfer)
throws java.io.IOException
transfer - the transfer objectorg.h2.message.DbException - if the server sent an exceptionjava.io.IOException - if there is a communication problem between client
and serverpublic static org.h2.message.DbException readException(org.h2.value.Transfer transfer)
throws java.io.IOException
transfer - the transfer objectjava.io.IOException - on I/O exceptionpublic boolean isClustered()
public boolean isClosed()
Sessionpublic void traceOperation(java.lang.String operation,
int id)
operation - the operation performedid - the id of the operationpublic void checkPowerOff()
org.h2.store.DataHandlercheckPowerOff in interface org.h2.store.DataHandlerpublic void checkWritingAllowed()
org.h2.store.DataHandlercheckWritingAllowed in interface org.h2.store.DataHandlerpublic java.lang.String getDatabasePath()
org.h2.store.DataHandlergetDatabasePath in interface org.h2.store.DataHandlerpublic int getMaxLengthInplaceLob()
org.h2.store.DataHandlergetMaxLengthInplaceLob in interface org.h2.store.DataHandlerpublic org.h2.store.FileStore openFile(java.lang.String name,
java.lang.String mode,
boolean mustExist)
org.h2.store.DataHandleropenFile in interface org.h2.store.DataHandlername - the file namemode - the modemustExist - whether the file must already existpublic org.h2.store.DataHandler getDataHandler()
SessiongetDataHandler in class Sessionpublic java.lang.Object getLobSyncObject()
org.h2.store.DataHandlergetLobSyncObject in interface org.h2.store.DataHandlerpublic org.h2.util.SmallLRUCache<java.lang.String,java.lang.String[]> getLobFileListCache()
org.h2.store.DataHandlergetLobFileListCache in interface org.h2.store.DataHandlerpublic int getLastReconnect()
public org.h2.util.TempFileDeleter getTempFileDeleter()
org.h2.store.DataHandlergetTempFileDeleter in interface org.h2.store.DataHandlerpublic org.h2.store.LobStorageFrontend getLobStorage()
org.h2.store.DataHandlergetLobStorage in interface org.h2.store.DataHandlerpublic int readLob(long lobId,
byte[] hmac,
long offset,
byte[] buff,
int off,
int length)
org.h2.store.DataHandlerreadLob in interface org.h2.store.DataHandlerlobId - the lob idhmac - the message authentication codeoffset - the offset within the lobbuff - the target bufferoff - the offset within the target bufferlength - the number of bytes to readpublic JavaObjectSerializer getJavaObjectSerializer()
CastDataProvidernull.getJavaObjectSerializer in interface CastDataProvidernullpublic org.h2.value.ValueLob addTemporaryLob(org.h2.value.ValueLob v)
SessionaddTemporaryLob in class Sessionv - the valuepublic org.h2.value.CompareMode getCompareMode()
org.h2.store.DataHandlergetCompareMode in interface org.h2.store.DataHandlerpublic boolean isRemote()
Sessionpublic java.lang.String getCurrentSchemaName()
SessiongetCurrentSchemaName in class Sessionpublic void setCurrentSchemaName(java.lang.String schema)
SessionsetCurrentSchemaName in class Sessionschema - the schema namepublic void setNetworkConnectionInfo(org.h2.util.NetworkConnectionInfo networkConnectionInfo)
SessionsetNetworkConnectionInfo in class SessionnetworkConnectionInfo - the network connection informationpublic IsolationLevel getIsolationLevel()
SessiongetIsolationLevel in class Sessionpublic void setIsolationLevel(IsolationLevel isolationLevel)
SessionsetIsolationLevel in class SessionisolationLevel - the isolation level to setpublic Session.StaticSettings getStaticSettings()
SessiongetStaticSettings in class Sessionpublic Session.DynamicSettings getDynamicSettings()
SessiongetDynamicSettings in class Sessionpublic org.h2.value.ValueTimestampTimeZone currentTimestamp()
CastDataProvidercurrentTimestamp in interface CastDataProviderpublic org.h2.util.TimeZoneProvider currentTimeZone()
CastDataProvidercurrentTimeZone in interface CastDataProviderpublic Mode getMode()
CastDataProvidergetMode in interface CastDataProviderpublic org.h2.jdbc.meta.DatabaseMeta getDatabaseMeta()
SessiongetDatabaseMeta in class Sessionpublic boolean isOldInformationSchema()
SessionisOldInformationSchema in class Sessionpublic boolean zeroBasedEnums()
CastDataProviderzeroBasedEnums in interface CastDataProvider