|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.engine.SessionWithState
org.h2.engine.SessionRemote
public class SessionRemote
The client side part of a session when using the server mode. This object communicates with a Session on the server side.
Field Summary | |
---|---|
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 |
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_PREPARE
|
static int |
SESSION_PREPARE_READ_PARAMS
|
static int |
SESSION_SET_ID
|
static int |
STATUS_CLOSED
|
static int |
STATUS_ERROR
|
static int |
STATUS_OK
|
static int |
STATUS_OK_STATE_CHANGED
|
Fields inherited from class org.h2.engine.SessionWithState |
---|
sessionState, sessionStateChanged |
Constructor Summary | |
---|---|
SessionRemote()
|
Method Summary | |
---|---|
int |
allocateObjectId(boolean needFresh,
boolean dataFile)
Get the next object id. |
void |
autoCommitIfCluster()
Calls COMMIT if the session is in cluster mode. |
boolean |
autoReconnect(int count)
Automatically re-connect if necessary and if configured to do so. |
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. |
int |
compareTypeSave(Value a,
Value b)
Compare two values. |
SessionInterface |
createSession(ConnectionInfo ci)
Create a new session. |
java.lang.String |
createTempFile()
Create a temporary file and return the file name. |
void |
done(Transfer transfer)
Called to flush the output after data has been sent to the server and just before receiving data. |
void |
freeUpDiskSpace()
Free up disk space if possible. |
int |
getChecksum(byte[] data,
int start,
int end)
Calculate the checksum for the byte array. |
int |
getClientVersion()
|
int |
getCurrentId()
|
java.lang.String |
getDatabasePath()
Get the database path. |
DataHandler |
getDataHandler()
Get the data handler object. |
int |
getLastReconnect()
|
java.lang.String |
getLobCompressionAlgorithm(int type)
Get the compression algorithm used for large objects. |
SmallLRUCache<java.lang.String,java.lang.String[]> |
getLobFileListCache()
Get the lob file list cache if it is used. |
boolean |
getLobFilesInDirectories()
Checks if the lob files stored in directories. |
java.lang.Object |
getLobSyncObject()
Get the synchronization object for lob operations. |
int |
getMaxLengthInplaceLob()
Get the maximum length of a in-place large object |
int |
getNextId()
|
int |
getPowerOffCount()
Get the number of disk operations before power failure is simulated. |
TempFileDeleter |
getTempFileDeleter()
Get the temp file deleter mechanism. |
Trace |
getTrace()
Get the trace writer. |
void |
handleInvalidChecksum()
Called when the checksum was invalid. |
boolean |
isClosed()
Check if close was called. |
boolean |
isClustered()
Returns true if the connection is in cluster mode. |
boolean |
isReconnectNeeded(boolean write)
Check if the database changed and therefore reconnecting is required. |
FileStore |
openFile(java.lang.String name,
java.lang.String mode,
boolean mustExist)
Open a file at the given location. |
CommandInterface |
prepareCommand(java.lang.String sql,
int fetchSize)
Parse a command and prepare it for execution. |
SessionInterface |
reconnect()
Close the connection and open a new connection. |
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)
|
void |
setPowerOffCount(int count)
Set the number of disk operations before power failure is simulated. |
void |
traceOperation(java.lang.String operation,
int id)
Write the operation to the trace system if debug trace is enabled. |
Methods inherited from class org.h2.engine.SessionWithState |
---|
readSessionState, recreateSessionState |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public 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_PREPARE_READ_PARAMS
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 STATUS_ERROR
public static final int STATUS_OK
public static final int STATUS_CLOSED
public static final int STATUS_OK_STATE_CHANGED
Constructor Detail |
---|
public SessionRemote()
Method Detail |
---|
public void cancel()
SessionInterface
cancel
in interface SessionInterface
public void cancelStatement(int id)
id
- the statement idpublic void setAutoCommit(boolean autoCommit)
public void autoCommitIfCluster() throws java.sql.SQLException
java.sql.SQLException
public int getPowerOffCount()
SessionInterface
getPowerOffCount
in interface SessionInterface
public void setPowerOffCount(int count) throws java.sql.SQLException
SessionInterface
setPowerOffCount
in interface SessionInterface
count
- the number of operations
java.sql.SQLException
public SessionInterface createSession(ConnectionInfo ci) throws java.sql.SQLException
SessionFactory
createSession
in interface SessionFactory
ci
- the connection parameters
java.sql.SQLException
public void removeServer(java.io.IOException e, int i, int count) throws java.sql.SQLException
e
- the exception (used for debugging)i
- the index of the server to removecount
- the retry count index
java.sql.SQLException
public CommandInterface prepareCommand(java.lang.String sql, int fetchSize) throws java.sql.SQLException
SessionInterface
prepareCommand
in interface SessionInterface
sql
- the SQL statementfetchSize
- the number of rows to fetch in one step
java.sql.SQLException
public boolean autoReconnect(int count) throws java.sql.SQLException
count
- the retry count index
java.sql.SQLException
public void checkClosed() throws java.sql.SQLException
java.sql.SQLException
- if the session is closedpublic void close() throws java.sql.SQLException
SessionInterface
close
in interface SessionInterface
java.sql.SQLException
public Trace getTrace()
DataHandler
getTrace
in interface SessionInterface
getTrace
in interface DataHandler
public int getNextId()
public int getCurrentId()
public void done(Transfer transfer) throws java.sql.SQLException, java.io.IOException
transfer
- the transfer object
java.sql.SQLException
- if the server sent an exception
java.io.IOException
- if there is a communication problem between client
and serverpublic boolean isClustered()
public boolean isClosed()
SessionInterface
isClosed
in interface SessionInterface
public void traceOperation(java.lang.String operation, int id)
operation
- the operation performedid
- the id of the operationpublic int allocateObjectId(boolean needFresh, boolean dataFile)
DataHandler
allocateObjectId
in interface DataHandler
needFresh
- if a fresh id is requireddataFile
- true if the id is for the data file
public void checkPowerOff()
DataHandler
checkPowerOff
in interface DataHandler
public void checkWritingAllowed()
DataHandler
checkWritingAllowed
in interface DataHandler
public int compareTypeSave(Value a, Value b)
DataHandler
compareTypeSave
in interface DataHandler
a
- the first valueb
- the second value
public java.lang.String createTempFile() throws java.sql.SQLException
DataHandler
createTempFile
in interface DataHandler
java.sql.SQLException
public void freeUpDiskSpace()
DataHandler
freeUpDiskSpace
in interface DataHandler
public int getChecksum(byte[] data, int start, int end)
DataHandler
getChecksum
in interface DataHandler
data
- the byte arraystart
- the starting offsetend
- the end offset
public java.lang.String getDatabasePath()
DataHandler
getDatabasePath
in interface DataHandler
public java.lang.String getLobCompressionAlgorithm(int type)
DataHandler
getLobCompressionAlgorithm
in interface DataHandler
type
- the data type (CLOB or BLOB)
public int getMaxLengthInplaceLob()
DataHandler
getMaxLengthInplaceLob
in interface DataHandler
public void handleInvalidChecksum() throws java.sql.SQLException
DataHandler
handleInvalidChecksum
in interface DataHandler
java.sql.SQLException
- if this should not be ignoredpublic FileStore openFile(java.lang.String name, java.lang.String mode, boolean mustExist) throws java.sql.SQLException
DataHandler
openFile
in interface DataHandler
name
- the file namemode
- the modemustExist
- whether the file must already exist
java.sql.SQLException
public DataHandler getDataHandler()
SessionInterface
getDataHandler
in interface SessionInterface
public java.lang.Object getLobSyncObject()
DataHandler
getLobSyncObject
in interface DataHandler
public boolean getLobFilesInDirectories()
DataHandler
getLobFilesInDirectories
in interface DataHandler
public SmallLRUCache<java.lang.String,java.lang.String[]> getLobFileListCache()
DataHandler
getLobFileListCache
in interface DataHandler
public int getClientVersion()
public int getLastReconnect()
public TempFileDeleter getTempFileDeleter()
DataHandler
getTempFileDeleter
in interface DataHandler
public boolean isReconnectNeeded(boolean write)
SessionInterface
isReconnectNeeded
in interface SessionInterface
write
- if the next operation may be writing
public SessionInterface reconnect()
SessionInterface
reconnect
in interface SessionInterface
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |