public class IsolatedClientSession extends ClientSession
connectionPolicy, isActive, parent, sequencing, writeConnection
accessor, broker, commitManager, ejbqlPlaceHolderQueries, eventManager, exceptionHandler, externalTransactionController, identityMapAccessor, integrityChecker, isInProfile, lastDescriptorAccessed, logSessionString, name, numberOfActiveUnitsOfWork, platform, profiler, project, properties, queries, sessionLog, transactionMutex, wasJTSTransactionInternallyStarted
Constructor and Description |
---|
IsolatedClientSession(ServerSession parent,
ConnectionPolicy connectionPolicy) |
Modifier and Type | Method and Description |
---|---|
Object |
executeCall(Call call,
AbstractRecord translationRow,
DatabaseQuery query)
INTERNAL:
Isolated sessions must forward call execution to its parent, unless in a transaction.
|
AbstractSession |
getExecutionSession(DatabaseQuery query)
INTERNAL:
Gets the session which this query will be executed on.
|
AbstractSession |
getParentIdentityMapSession(DatabaseQuery query,
boolean canReturnSelf,
boolean terminalOnly)
INTERNAL:
Gets the next link in the chain of sessions followed by a query's check
early return, the chain of sessions with identity maps all the way up to
the root session.
|
void |
initializeIdentityMapAccessor()
INTERNAL:
Set up the IdentityMapManager.
|
protected boolean |
isIsolatedQuery(DatabaseQuery query)
INTERNAL: Answers if this query is an isolated query and must be
executed locally.
|
protected boolean |
shouldExecuteLocally(DatabaseQuery query)
INTERNAL:
Helper method to calculate whether to execute this query locally or send
it to the server session.
|
afterTransaction, basicBeginTransaction, basicCommitTransaction, basicRollbackTransaction, connect, containsQuery, disconnect, finalize, getAccessor, getConnectionPolicy, getDescriptors, getParent, getQuery, getQuery, getSequencing, getServerPlatform, getSessionTypeString, getWriteConnection, hasWriteConnection, initializeSequencing, isActive, isClientSession, isConnected, release, releaseWriteConnection, setConnectionPolicy, setIsActive, setParent, setWriteConnection, toString
acquireNonSynchronizedUnitOfWork, acquireUnitOfWork, addAlias, addEjbqlPlaceHolderQuery, addQuery, addQuery, beginExternalTransaction, beginTransaction, clearIntegrityChecker, clearLastDescriptorAccessed, clearProfile, clone, commitExternalTransaction, commitTransaction, compareObjects, compareObjectsDontMatch, config, copyObject, copyObject, copyReadOnlyClasses, deleteAllObjects, deleteAllObjects, deleteObject, doesObjectExist, dontLogMessages, endOperationProfile, executeNonSelectingCall, executeNonSelectingSQL, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeSelectingCall, executeSQL, fine, finer, finest, getAccessor, getAccessor, getActiveSession, getActiveUnitOfWork, getAliasDescriptors, getAllQueries, getBroker, getClassDescriptor, getClassDescriptor, getClassDescriptorForAlias, getCommitManager, getDatasourceLogin, getDatasourcePlatform, getDefaultReadOnlyClasses, getDescriptor, getDescriptor, getDescriptorForAlias, getEjbqlPlaceHolderQueries, getEventManager, getExceptionHandler, getExceptionHandlerClass, getExternalTransactionController, getIdentityMapAccessor, getIdentityMapAccessorInstance, getIntegrityChecker, getLog, getLogin, getLogLevel, getLogLevel, getLogSessionString, getName, getNextQueryId, getNextSequenceNumberValue, getNumberOfActiveUnitsOfWork, getParentIdentityMapSession, getPlatform, getPlatform, getProfiler, getProject, getProperties, getProperty, getQueries, getRootSession, getSessionForClass, getSessionLog, getTransactionMutex, handleException, handleSevere, hasBroker, hasDescriptor, hasExceptionHandler, hasExternalTransactionController, hasProperties, incrementProfile, info, insertObject, internalExecuteQuery, isBroker, isClassReadOnly, isClassReadOnly, isDatabaseSession, isDistributedSession, isInBroker, isInProfile, isInTransaction, isRemoteSession, isRemoteUnitOfWork, isServerSession, isSessionBroker, isUnitOfWork, keyFromObject, keyFromObject, log, log, log, log, log, log, log, log, log, log, logMessage, logThrowable, prepareDatabaseQuery, processEJBQLQueries, processEJBQLQueries, readAllObjects, readAllObjects, readAllObjects, readAllObjects, readObject, readObject, readObject, readObject, readObject, refreshAndLockObject, refreshAndLockObject, refreshObject, releaseUnitOfWork, removeProperty, removeQuery, removeQuery, rollbackExternalTransaction, rollbackTransaction, setAccessor, setBroker, setCommitManager, setDatasourceLogin, setEventManager, setExceptionHandler, setExternalTransactionController, setIntegrityChecker, setIsInProfile, setLog, setLogin, setLogin, setLogLevel, setName, setNumberOfActiveUnitsOfWork, setProfiler, setProject, setProperties, setProperty, setQueries, setSessionLog, setTransactionMutex, setWasJTSTransactionInternallyStarted, severe, shouldLog, shouldLogMessages, startOperationProfile, unwrapObject, updateObject, updateProfile, validateQuery, verifyDelete, warning, wasJTSTransactionInternallyStarted, wrapObject, writeAllObjects, writeAllObjectsWithChangeSet, writeObject, writesCompleted
public IsolatedClientSession(ServerSession parent, ConnectionPolicy connectionPolicy)
public void initializeIdentityMapAccessor()
initializeIdentityMapAccessor
in class ClientSession
protected boolean shouldExecuteLocally(DatabaseQuery query)
protected boolean isIsolatedQuery(DatabaseQuery query)
public AbstractSession getParentIdentityMapSession(DatabaseQuery query, boolean canReturnSelf, boolean terminalOnly)
Used for session broker which delegates to registered sessions, or UnitOfWork which checks parent identity map also.
getParentIdentityMapSession
in class ClientSession
canReturnSelf
- true when method calls itself. If the path
starting at this
is acceptable. Sometimes true if want to
move to the first valid session, i.e. executing on ClientSession when really
should be on ServerSession.terminalOnly
- return the session we will execute the call on, not
the next step towards it.public AbstractSession getExecutionSession(DatabaseQuery query)
Since the execution session also knows the correct datasource platform to execute on, it is often used in the mappings where the platform is needed for type conversion, or where calls are translated.
Is also the session with the accessor. Will return a ClientSession if it is in transaction and has a write connection.
getExecutionSession
in class ClientSession
query
- may store session name or reference class for brokers casepublic Object executeCall(Call call, AbstractRecord translationRow, DatabaseQuery query) throws DatabaseException
executeCall
in class AbstractSession
DatabaseException
Copyright © 2021. All rights reserved.