Methods Summary |
---|
public java.lang.Object | executeCall(oracle.toplink.essentials.queryframework.Call call, oracle.toplink.essentials.internal.sessions.AbstractRecord translationRow, oracle.toplink.essentials.queryframework.DatabaseQuery query)INTERNAL:
Isolated sessions must forward call execution to its parent, unless in a transaction.
This is required as isolated sessions are always the execution session for isolated classes.
if (isInTransaction()) {
return super.executeCall(call, translationRow, query);
}
return getParent().executeCall(call, translationRow, query);
|
public oracle.toplink.essentials.internal.sessions.AbstractSession | getExecutionSession(oracle.toplink.essentials.queryframework.DatabaseQuery query)INTERNAL:
Gets the session which this query will be executed on.
Generally will be called immediately before the call is translated,
which is immediately before session.executeCall.
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.
if (shouldExecuteLocally(query)) {
return this;
} else {
return getParent().getExecutionSession(query);
}
|
public oracle.toplink.essentials.internal.sessions.AbstractSession | getParentIdentityMapSession(oracle.toplink.essentials.queryframework.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.
Used for session broker which delegates to registered sessions, or UnitOfWork
which checks parent identity map also.
if ((query != null) && isIsolatedQuery(query)) {
return this;
} else {
return getParent().getParentIdentityMapSession(query, canReturnSelf, terminalOnly);
}
|
public void | initializeIdentityMapAccessor()INTERNAL:
Set up the IdentityMapManager. This method allows subclasses of Session to override
the default IdentityMapManager functionality.
this.identityMapAccessor = new IsolatedClientSessionIdentityMapAccessor(this, new IdentityMapManager(this));
|
protected boolean | isIsolatedQuery(oracle.toplink.essentials.queryframework.DatabaseQuery query)INTERNAL: Answers if this query is an isolated query and must be
executed locally.
query.checkDescriptor(this);
if (query.isDataModifyQuery() || ((query.getDescriptor() != null) && query.getDescriptor().isIsolated())) {
// For CR#4334 if in transaction stay on client session.
// That way client's write accessor will be used for all queries.
// This is to preserve transaction isolation levels.
// also if this is an isolated class and we are in an isolated session
//load locally.
return true;
}
return false;
|
protected boolean | shouldExecuteLocally(oracle.toplink.essentials.queryframework.DatabaseQuery query)INTERNAL:
Helper method to calculate whether to execute this query locally or send
it to the server session.
if (isIsolatedQuery(query)) {
return true;
}
return isInTransaction();
|