Class AbstractSession
- All Implemented Interfaces:
Serializable
,Cloneable
,CoreSession<ClassDescriptor,
,Login, Platform, Project, SessionEventManager> CommandProcessor
,Session
- Direct Known Subclasses:
ClientSession
,DatabaseSessionImpl
,HistoricalSession
,UnitOfWorkImpl
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected Collection
<Accessor> The connection to the data store.protected ExposedNodeLinkedList
List of active command threads.protected Map
<String, AttributeGroup> Stores predefined reusable AttributeGroups.protected AbstractSession
Support being owned by a session broker.protected CommandManager
Used to connect this session to EclipseLink cluster for distributed commandprotected CommitManager
Resolves referential integrity on commits.protected ReferenceMode
Stores the default reference mode that a UnitOfWork will use when referencing managed objects.protected List
<DescriptorEvent> temporarily holds a list of events that must be fired after the current operation completes.protected Map
<Class<?>, ClassDescriptor> PERF: cache descriptors from project.protected SessionEventManager
Stores the event listeners for this session.protected ExceptionHandler
ExceptionHandler handles database exceptions.protected ExternalTransactionController
Delegate that handles synchronizing a UnitOfWork with an external transaction.protected IdentityMapAccessor
Manages the live object cache.protected InjectionManager
<?> Allow CDI injection of entity listenersprotected IntegrityChecker
IntegrityChecker catch all the descriptor Exceptions.protected boolean
Allow a session to enable concurrent processing.protected boolean
records that the UOW is executing deferred events.protected boolean
PERF: Allow for finalizers to be enabled, currently enables client-session finalize.protected boolean
Used to determine If a session is in a Broker or notprotected boolean
Used to determine If a session is in a profile or notprotected boolean
PERF: Quick check if logging is OFF entirely.protected boolean
Indicates whether the session is synchronized.protected boolean
Stores predefined not yet parsed JPQL queries.protected ClassDescriptor
Last descriptor accessed, use to optimize descriptor lookup.protected String
When logging the name of the session is typed: class name + system hashcode.protected MetadataRefreshListener
the MetadataRefreshListener is used with RCM to force a refresh of the metadata used within EntityManagerFactoryWrappersStores the set of multitenant context properties this session requiresprotected String
Used to identify a session when using the session broker.protected int
Keep track of active units of work.protected Map
This collection will be used to store those objects that are currently locked for the clone process.protected PartitioningPolicy
Allow queries to be targeted at specific connection pools.protected Integer
Default pessimistic lock timeout value.protected TimeUnit
protected Platform
Allow the datasource platform to be cached.protected SessionProfiler
Tool that log performance information.protected Project
The project stores configuration information, such as the descriptors and login.Allow for user defined properties.protected Map
<String, List<DatabaseQuery>> Stores predefine reusable queries.protected JPAQueryBuilder
Store the query builder used to parse JPQL.protected int
protected TimeUnit
protected Serializer
Set the Serializer to use by default for serialization.protected SessionLog
Destination for logged messages and SQL.protected boolean
PERF: Cache the write-lock check to avoid cost of checking in every register/clone.protected boolean
Indicates whether ObjectLevelReadQuery should by default use ResultSet Access optimization.protected boolean
Determined whether changes should be propagated to an EclipseLink clusterThis map will hold onto class to static metamodel class references from JPA.protected List
<ClassDescriptor> PERF: cache table per tenant descriptors needing to be initialized per EMprotected List
<DatabaseQuery> PERF: cache table per tenant queries needing to be initialized per EMprotected boolean
Indicates whether Session creation should tolerate an invalid NamedQuery.protected ConcurrencyManager
Ensure mutual exclusion of the session's transaction state across multiple threads.protected boolean
If Transactions were externally startedFields inherited from interface org.eclipse.persistence.sessions.coordination.CommandProcessor
LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING
-
Constructor Summary
ModifierConstructorDescriptionprotected
INTERNAL: Create and return a new session.protected
AbstractSession
(int nothing) INTERNAL: Create a blank session, used for proxy session.protected
AbstractSession
(Login login) PUBLIC: Create and return a new session.protected
AbstractSession
(Project project) PUBLIC: Create and return a new session. -
Method Summary
Modifier and TypeMethodDescriptionacquireHistoricalSession
(AsOfClause clause) INTERNAL: Constructs a HistoricalSession given a valid AsOfClause.INTERNAL: Return a unit of work for this session not registered with the JTS transaction.acquireNonSynchronizedUnitOfWork
(ReferenceMode referenceMode) INTERNAL: Return a unit of work for this session not registered with the JTS transaction.acquireRepeatableWriteUnitOfWork
(ReferenceMode referenceMode) PUBLIC: Return a repeatable write unit of work for this session.PUBLIC: Return a unit of work for this session.acquireUnitOfWork
(ReferenceMode referenceMode) PUBLIC: Return a unit of work for this session.void
addAlias
(String alias, ClassDescriptor descriptor) PUBLIC: Add an alias for the descriptorvoid
addJPAQuery
(DatabaseQuery query) INTERNAL: Return all pre-defined not yet parsed EJBQL queries.void
INTERNAL: Return all pre-defined not yet parsed EJBQL multitenant queries.void
addMultitenantContextProperty
(String contextProperty) PUBLIC: Return a set of multitenant context properties this sessionvoid
addQuery
(String name, DatabaseQuery query) PUBLIC: Add the query to the session queries with the given name.void
addQuery
(String name, DatabaseQuery query, boolean replace) PUBLIC: Add the query to the session queries with the given name.protected void
addQuery
(DatabaseQuery query, boolean nameMustBeUnique) INTERNAL: Add the query to the session queries.void
addStaticMetamodelClass
(String modelClassName, String metamodelClassName) INTERNAL: Add a metamodel class to model class reference.protected void
addTablePerTenantDescriptor
(ClassDescriptor descriptor) INTERNAL: Add a descriptor that is uses a table per tenant multitenant policy.protected void
INTERNAL: Add a query that queries a table per tenant entityprotected void
INTERNAL: Called by beginTransaction() to start a transaction.protected void
basicBeginTransaction
(Accessor accessor) INTERNAL: Called by beginTransaction() to start a transaction.protected void
INTERNAL: Called by commitTransaction() to commit a transaction.basicExecuteCall
(Call call, AbstractRecord translationRow, DatabaseQuery query) INTERNAL: Execute the call on each accessors and merge the results.protected void
INTERNAL: Called by rollbackTransaction() to rollback a transaction.boolean
INTERNAL: Attempts to begin an external transaction.void
PUBLIC: Begin a transaction on the database.protected JPAQueryBuilder
INTERNAL Build the JPQL builder based on session properties.void
checkAndRefreshInvalidObject
(Object object, CacheKey cacheKey, ClassDescriptor descriptor) INTERNAL: Check if the object is invalid and refresh it.protected ClassDescriptor
checkHierarchyForDescriptor
(Class<?> theClass) Check to see if the descriptor of a superclass can be used to describe this classvoid
allow the entity listener injection manager to clean itself up.void
INTERNAL: Clear the the descriptors cache.void
PUBLIC: clear the integrityChecker.void
INTERNAL: Clear the the lastDescriptorAccessed cache.void
PUBLIC: Clear the profiler, this will end the current profile operation.clone()
INTERNAL: Clones the descriptorboolean
INTERNAL: Attempts to commit the running internally started external transaction.void
PUBLIC: Commit the active database transaction.boolean
compareObjects
(Object firstObject, Object secondObject) INTERNAL: Return if the two object match completely.boolean
compareObjectsDontMatch
(Object firstObject, Object secondObject) TESTING: Return true if the object do not match.void
PUBLIC:boolean
containsQuery
(String queryName) PUBLIC: Return true if the pre-defined query is defined on the session.PUBLIC: Return a complete copy of the object or of collection of objects.copy
(Object originalObjectOrObjects, AttributeGroup group) PUBLIC: Return a complete copy of the object or of collection of objects.void
copyDescriptorNamedQueries
(boolean allowSameQueryNameDiffArgsCopyToSession) INTERNAL: This method will be used to copy all EclipseLink named queries defined in descriptors into the session.void
INTERNAL: Copies descriptors cached on the Project.copyInternal
(Object originalObject, CopyGroup copyGroup) INTERNAL:INTERNAL: Copy the read only classes from the unit of work Added Nov 8, 2000 JED for Patch 2.5.1.8 Ref: Prs 24502<T> DatabaseValueHolder
<T> createCloneQueryValueHolder
(ValueHolderInterface<T> attributeValue, Object clone, AbstractRecord row, ForeignReferenceMapping mapping) <T> DatabaseValueHolder
<T> createCloneTransformationValueHolder
(ValueHolderInterface<T> attributeValue, Object original, Object clone, AbstractTransformationMapping mapping) <T> InjectionManager
<T> createInjectionManager
(Object beanManager) createProtectedInstanceFromCachedData
(Object cached, Integer refreshCascade, ClassDescriptor descriptor) INTERNAL: This method is similar to getAndCloneCacheKeyFromParent.void
deferEvent
(DescriptorEvent event) INTERNAL: Add an event to the deferred list.void
deleteAllObjects
(Collection domainObjects) PUBLIC: delete all of the objects and all of their privately owned parts in the database.deleteObject
(Object domainObject) PUBLIC: Delete the object and all of its privately owned parts from the database.boolean
doesObjectExist
(Object object) PUBLIC: Return if the object exists on the database or not.void
PUBLIC: Turn off loggingvoid
endOperationProfile
(String operationName) INTERNAL: End the operation timing.void
endOperationProfile
(String operationName, DatabaseQuery query, int weight) INTERNAL: End the operation timing.executeCall
(Call call, AbstractRecord translationRow, DatabaseQuery query) INTERNAL: Overridden by subclasses that do more than just execute the call.void
INTERNAL: Causes any deferred events to be fired.int
executeNonSelectingCall
(Call call) PUBLIC: Execute the call on the database.void
executeNonSelectingSQL
(String sqlString) PUBLIC: Execute the sql on the database.executeQuery
(String queryName) PUBLIC: Execute the pre-defined query by name and return the result.executeQuery
(String queryName, Class<?> domainClass) PUBLIC: Execute the pre-defined query by name and return the result.executeQuery
(String queryName, Class<?> domainClass, Object arg1) PUBLIC: Execute the pre-defined query by name and return the result.executeQuery
(String queryName, Class<?> domainClass, Object arg1, Object arg2) PUBLIC: Execute the pre-defined query by name and return the result.PUBLIC: Execute the pre-defined query by name and return the result.executeQuery
(String queryName, Class<?> domainClass, List argumentValues) PUBLIC: Execute the pre-defined query by name and return the result.executeQuery
(String queryName, Class<?> domainClass, Vector argumentValues) PUBLIC: Execute the pre-defined query by name and return the result.executeQuery
(String queryName, Object arg1) PUBLIC: Execute the pre-defined query by name and return the result.executeQuery
(String queryName, Object arg1, Object arg2) PUBLIC: Execute the pre-defined query by name and return the result.executeQuery
(String queryName, Object arg1, Object arg2, Object arg3) PUBLIC: Execute the pre-defined query by name and return the result.executeQuery
(String queryName, List argumentValues) PUBLIC: Execute the pre-defined query by name and return the result.executeQuery
(String queryName, Vector argumentValues) PUBLIC: Execute the pre-defined query by name and return the result.executeQuery
(DatabaseQuery query) PUBLIC: Execute the database query.executeQuery
(DatabaseQuery query, List argumentValues) PUBLIC: Return the results from executing the database query.executeQuery
(DatabaseQuery query, AbstractRecord row) INTERNAL: Return the results from executing the database query.executeQuery
(DatabaseQuery query, AbstractRecord row, int retryCount) INTERNAL: Return the results from executing the database query.executeSelectingCall
(Call call) PUBLIC: Execute the call on the database and return the result.executeSQL
(String sqlString) PUBLIC: Execute the sql on the database and return the result.void
PUBLIC:void
PUBLIC:void
PUBLIC:INTERNAL: This should normally not be used, most sessions do not have a single accessor.INTERNAL: This should normally not be used, most sessions do not have specific accessors.getAccessors
(Call call, AbstractRecord translationRow, DatabaseQuery query) INTERNAL: Return the connections to use for the query execution.INTERNAL:PUBLIC: Return the active session for the current active external (JTS) transaction.PUBLIC: Return the active unit of work for the current active external (JTS) transaction.INTERNAL: Returns the alias descriptors Map.INTERNAL: Return the pre-defined queries in this session.ADVANCED: Answers the past time this session is as of.ADVANCED Return all predefined attribute groupsINTERNAL: Allow the session to be used from a session broker.protected CacheKey
getCacheKeyFromTargetSessionForMerge
(Object implementation, ObjectBuilder builder, ClassDescriptor descriptor, MergeManager mergeManager) INTERNAL: For use within the merge process this method will get an object from the shared cache using a readlock.getClassDescriptor
(Class<?> theClass) ADVANCED: Return the descriptor specified for the class.getClassDescriptor
(Object domainObject) ADVANCED: Return the descriptor specified for the object's class.getClassDescriptorForAlias
(String alias) PUBLIC: Return the descriptor for the alias.PUBLIC: Return the CommandManager that allows this session to act as a CommandProcessor and receive or propagate commands from/to the EclipseLink cluster.INTERNAL: The commit manager is used to resolve referential integrity on commits of multiple objects.PUBLIC: Return the login, the login holds any database connection information given.INTERNAL: Return the database platform currently connected to.INTERNAL: Returns the set of read-only classes that gets assigned to each newly created UnitOfWork.Stores the default Session wide reference mode that a UnitOfWork will use when referencing managed objects.getDescriptor
(Class<?> theClass) ADVANCED: Return the descriptor specified for the class.getDescriptor
(Object domainObject) ADVANCED: Return the descriptor specified for the object's class.getDescriptorForAlias
(String alias) PUBLIC: Return the descriptor for the alias.Map
<Class<?>, ClassDescriptor> ADVANCED: Return all registered descriptors.PUBLIC: Return the event manager.PUBLIC: Return the ExceptionHandler.Exception handler can catch errors that occur on queries or during database access.INTERNAL: Return a string which represents my ExceptionHandler's class Added for F2104: Properties.xml - gngetExecutionSession
(DatabaseQuery query) INTERNAL: Gets the session which this query will be executed on.PUBLIC: Used for JTS integration.ADVANCED: Extract and return the primary key from the object.PUBLIC: The IdentityMapAccessor is the preferred way of accessing IdentityMap funcitons This will return an object which implements an interface which exposes all public IdentityMap functions.INTERNAL: Return the internally available IdentityMapAccessor instance.<T> InjectionManager
<T> PUBLIC: Returns the integrityChecker.IntegrityChecker holds all the ClassDescriptor Exceptions.ADVANCED: Return all pre-defined not yet parsed JPQL queries.ADVANCED: Return all pre-defined not yet parsed JPQL queries.INTERNAL: Return the class loader for the session's application.getLog()
PUBLIC: Return the writer to which an accessor writes logged messages and SQL.getLogin()
OBSOLETE: Return the login, the login holds any database connection information given.int
PUBLIC:int
getLogLevel
(String category) PUBLIC:INTERNAL: Return the name of the session: class name + system hashcode.getMappedSuperclass
(String className) INTERNAL: Return the mapped superclass descriptor if one exists for the given class name.PUBLIC: Return a set of multitenant context properties this sessiongetName()
PUBLIC: Return the name of the session.long
INTERNAL: Called by a sessions queries to obtain individual query ids.getNextSequenceNumberValue
(Class<?> domainClass) ADVANCED: Return the sequnce number from the databaseint
INTERNAL: Return the number of units of work connected.INTERNAL: Gets the parent session.getParentIdentityMapSession
(ClassDescriptor descriptor, boolean canReturnSelf, boolean terminalOnly) INTERNAL: Returns the appropriate IdentityMap session for this descriptor.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.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.PUBLIC: Return the session's partitioning policy.INTERNAL: Returns the default pessimistic lock timeout value.INTERNAL: Return the database platform currently connected to.getPlatform
(Class<?> domainClass) INTERNAL: Return the database platform currently connected to for specified class.PUBLIC: Return the profiler.PUBLIC: Return the project, the project holds configuartion information including the descriptors.ADVANCED: Allow for user defined properties.getProperty
(String name) ADVANCED: Returns the user defined property.ADVANCED: Return all pre-defined queries.PUBLIC: Return the query from the session pre-defined queries with the given name.PUBLIC: Return the query from the session pre-defined queries with the given name and argument types.PUBLIC: Return the query from the session pre-defined queries with the given name and argument types.INTERNAL: Return the query from the session pre-defined queries with the given name and argument types.INTERNAL Return the query builder used to parser JPQL.int
PUBLIC: Return the default query timeout for this session.INTERNAL: This currently only used by JPA with RCM to force a refresh of the metadata used within EntityManagerFactoryWrappersgetRootSession
(DatabaseQuery query) INTERNAL: The session that this query is executed against when not in transaction.INTERNAL: Return the Sequencing object used by the session.Return the Serializer to use by default for serialization.INTERNAL: Marked internal as this is not customer API but helper methods for accessing the server platform from within EclipseLink's other sessions types (ie not DatabaseSession)getSessionForClass
(Class<?> domainClass) INTERNAL: Return the session to be used for the class.getSessionForName
(String name) INTERNAL: Return the session by name.PUBLIC: Return the session log to which an accessor logs messages and SQL.INTERNAL: Returns the type of session, its class.getStaticMetamodelClass
(String modelClassName) INTERNAL: Return the static metamodel class associated with the given model class if available.INTERNAL: Return list of table per tenant multitenant descriptors.INTERNAL: Return list of table per tenant multitenant descriptors.INTERNAL: The transaction mutex ensure mutual exclusion on transaction across multiple threads.handleException
(RuntimeException exception) PUBLIC: Allow any WARNING level exceptions that occur within EclipseLink to be logged and handled by the exception handler.handleSevere
(RuntimeException exception) PUBLIC: Allow any SEVERE level exceptions that occur within EclipseLink to be logged and handled by the exception handler.boolean
INTERNAL: Allow the session to be used from a session broker.boolean
INTERNAL: Return if the commit manager has been set.boolean
hasDescriptor
(Class<?> theClass) ADVANCED: Return true if a descriptor exists for the given class.boolean
INTERNAL: Return if an event manager has been set.boolean
PUBLIC: Return if an exception handler is present.boolean
PUBLIC: Used for JTA integration.boolean
INTERNAL: Allow to check for user defined properties.boolean
INTERNAL: Return list of table per tenant multitenant descriptors.boolean
INTERNAL: Return a list of table per tenant multitenant queries.void
incrementProfile
(String operationName) INTERNAL: Updates the count of SessionProfiler eventvoid
incrementProfile
(String operationName, DatabaseQuery query) INTERNAL: Updates the count of SessionProfiler eventvoid
PUBLIC:void
INTERNAL: Set up the IdentityMapManager.insertObject
(Object domainObject) PUBLIC: Insert the object and all of its privately owned parts into the database.internalExecuteQuery
(DatabaseQuery query, AbstractRecord databaseRow) INTERNAL: Return the results from exeucting the database query.boolean
isBroker()
INTERNAL: Returns true if the session is a session Broker.boolean
isClassReadOnly
(Class<?> theClass) PUBLIC: Return if the class is defined as read-only.boolean
isClassReadOnly
(Class<?> theClass, ClassDescriptor descriptor) INTERNAL: Return if the class is defined as read-only.boolean
PUBLIC: Return if this session is a client session.boolean
ADVANCED: Return if the session enables concurrent processing.boolean
PUBLIC: Return if this session is connected to the database.boolean
isConsideredInvalid
(Object object, CacheKey cacheKey, ClassDescriptor descriptor) INTERNAL: Check if the object is invalid and *should* be refreshed.boolean
PUBLIC: Return if this session is a database session.boolean
PUBLIC: Return if this session is a distributed session.boolean
INTERNAL: This method is called in case externalConnectionPooling is used.boolean
PUBLIC: Return if this session is an exclusive isolated client session.boolean
PUBLIC: Return if this session's decendants should use finalizers.boolean
INTERNAL: Return if this session is a historical session.boolean
INTERNAL: Returns true if the session is in a session Broker.boolean
PUBLIC: Return if a profiler is being used.boolean
PUBLIC: Return if the session is currently in the progress of a database transaction.boolean
PUBLIC: Return if this session is an isolated client session.boolean
INTERNAL: used to see if JPA Queries have been processed during initializationboolean
INTERNAL: PERF: Used for quick check if logging is OFF entirely.boolean
PUBLIC: Returns true if Protected Entities should be built within this sessionboolean
PUBLIC: Return if this session is remote.boolean
PUBLIC: Return if this session is a unit of work.boolean
PUBLIC: Return if this session is a server session.boolean
PUBLIC: Return if this session is a session broker.boolean
INTERNAL: Return if this session is synchronized.boolean
PUBLIC: Return if this session is a unit of work.keyFromObject
(Object domainObject, ClassDescriptor descriptor) ADVANCED: Extract and return the primary key from the object.void
load
(Object objectOrCollection, AttributeGroup group) This method will load the passed object or collection of objects using the passed AttributeGroup.void
load
(Object objectOrCollection, AttributeGroup group, ClassDescriptor referenceDescriptor, boolean fromFetchGroup) This method will load the passed object or collection of objects using the passed AttributeGroup.void
PUBLIC:void
PUBLIC:void
PUBLIC:void
PUBLIC:void
log
(int level, String category, String message, Object[] params, Accessor accessor, boolean shouldTranslate) PUBLIC:void
PUBLIC:void
PUBLIC:void
log
(SessionLogEntry entry) PUBLIC: Log the log entry.void
logMessage
(int logLevel, String message) INTERNAL: RemoteCommandManager method.void
logMessage
(String message) Log a untranslated message to the EclipseLink log at FINER level.void
logThrowable
(int level, String category, Throwable throwable) PUBLIC:void
postAcquireConnection
(Accessor accessor) INTERNAL: This method rises appropriate for the session event(s) right after connection is acquired.INTERNAL: A call back to do session specific preparation of a query.void
preReleaseConnection
(Accessor accessor) INTERNAL: This method rises appropriate for the session event(s) right before the connection is released.int
INTERNAL: Execute the call on the database.INTERNAL: Execute the call on the database and return the result.void
processCommand
(Object command) INTERNAL: RemoteCommandManager method.void
INTERNAL: Process the JPA named queries into EclipseLink Session queries.protected void
processJPAQuery
(DatabaseQuery jpaQuery) INTERNAL: Process the JPA named query into an EclipseLink Session query.readAllObjects
(Class<?> domainClass) PUBLIC: Read all of the instances of the class from the database.readAllObjects
(Class<?> domainClass, String sqlString) PUBLIC: Read all of the instances of the class from the database return through execution the SQL string.readAllObjects
(Class<?> domainClass, Expression expression) PUBLIC: Read all of the instances of the class from the database matching the given expression.readAllObjects
(Class<?> referenceClass, Call aCall) PUBLIC: Read all the instances of the class from the database returned through execution the Call string.readObject
(Class<?> domainClass) PUBLIC: Read the first instance of the class from the database.readObject
(Class<?> domainClass, String sqlString) PUBLIC: Read the first instance of the class from the database return through execution the SQL string.readObject
(Class<?> domainClass, Expression expression) PUBLIC: Read the first instance of the class from the database matching the given expression.readObject
(Class<?> domainClass, Call aCall) PUBLIC: Read the first instance of the class from the database returned through execution the Call string.readObject
(Object object) PUBLIC: Use the example object to consruct a read object query by the objects primary key.refreshAndLockObject
(Object object) PUBLIC: Refresh the attributes of the object and of all of its private parts from the database.refreshAndLockObject
(Object object, short lockMode) PUBLIC: Refresh the attributes of the object and of all of its private parts from the database.refreshObject
(Object object) PUBLIC: Refresh the attributes of the object and of all of its private parts from the database.void
INTERNAL: Register a finalizer to release this session.void
release()
PUBLIC: Release the session.void
INTERNAL: Release (if required) connection after call.void
INTERNAL: Called in the end of beforeCompletion of external transaction synchronization listener.void
releaseReadConnection
(Accessor connection) INTERNAL:void
releaseUnitOfWork
(UnitOfWorkImpl unitOfWork) INTERNAL: Release the unit of work, if lazy release the connection.void
removeProperty
(String property) PUBLIC: Remove the user defined property.void
removeQuery
(String queryName) PUBLIC: Remove all queries with the given queryName regardless of the argument types.void
removeQuery
(String queryName, Vector argumentTypes) PUBLIC: Remove the specific query with the given queryName and argumentTypes.retrieveCacheKey
(Object primaryKey, ClassDescriptor concreteDescriptor, JoinedAttributeManager joinManager, ObjectBuildingQuery query) retryQuery
(DatabaseQuery query, AbstractRecord row, DatabaseException databaseException, int retryCount, AbstractSession executionSession) INTERNAL: A query execution failed due to an invalid query.retryTransaction
(Accessor accessor, DatabaseException databaseException, int retryCount, AbstractSession executionSession) INTERNAL: A begin transaction failed.protected boolean
PROTECTED: Attempts to rollback the running internally started external transaction.void
PUBLIC: Rollback the active database transaction.void
setAccessor
(Accessor accessor) INTERNAL: Set the accessor.void
setBroker
(AbstractSession broker) INTERNAL: Allow the session to be used from a session broker.void
ADVANCED: Set the CommandManager that allows this session to act as a CommandProcessor and receive or propagate commands from/to the EclipseLink cluster.void
setCommitManager
(CommitManager commitManager) INTERNAL: The commit manager is used to resolve referncial integrity on commits of multiple objects.void
setDatasourceLogin
(Login login) PUBLIC: Set the login.void
setDefaultReferenceMode
(ReferenceMode defaultReferenceMode) Stores the default Session wide reference mode that a UnitOfWork will use when referencing managed objects.void
setEventManager
(SessionEventManager eventManager) INTERNAL: Set the event manager.void
setExceptionHandler
(ExceptionHandler exceptionHandler) PUBLIC: Set the exceptionHandler.void
setExternalTransactionController
(ExternalTransactionController externalTransactionController) Used for JTS integration internally by ServerPlatform.void
setInjectionManager
(InjectionManager<?> injectionManager) void
setIntegrityChecker
(IntegrityChecker integrityChecker) PUBLIC: set the integrityChecker.void
setIsConcurrent
(boolean isConcurrent) ADVANCED: Set if the session enables concurrent processing.void
setIsFinalizersEnabled
(boolean isFinalizersEnabled) PUBLIC: Set if this session's decendants should use finalizers.void
setIsInBroker
(boolean isInBroker) INTERNAL: Set if this session is contained in a SessionBroker.void
setIsInProfile
(boolean inProfile) PUBLIC: Allow for user deactive a profilervoid
setJPAQueriesProcessed
(boolean jpaQueriesProcessed) INTERNAL: used to set if JPA Queries have been processed during initializationvoid
PUBLIC: Set the writer to which an accessor writes logged messages and SQL.void
setLoggingOff
(boolean loggingOff) INTERNAL: PERF: Used for quick turning logging ON/OFF entirely.void
setLogin
(DatabaseLogin login) PUBLIC: Set the login.void
PUBLIC: Set the login.void
setLogLevel
(int level) PUBLIC:void
PUBLIC: Set the name of the session.protected void
setNumberOfActiveUnitsOfWork
(int numberOfActiveUnitsOfWork) void
setPartitioningPolicy
(PartitioningPolicy partitioningPolicy) PUBLIC: Set the session's partitioning policy.void
setPessimisticLockTimeoutDefault
(Integer pessimisticLockTimeoutDefault) PUBLIC: Set the default pessimistic lock timeout value.void
setPessimisticLockTimeoutUnitDefault
(TimeUnit pessimisticLockTimeoutUnitDefault) void
setProfiler
(SessionProfiler profiler) PUBLIC: Set the profiler for the session.void
setProject
(Project project) INTERNAL: Set the project, the project holds configuration information including the descriptors.void
setProperties
(Map<String, Object> propertiesMap) INTERNAL: Set the user defined properties by shallow copying the propertiesMap.void
setProperty
(String propertyName, Object propertyValue) PUBLIC: Allow for user defined properties.void
setQueries
(Map<String, List<DatabaseQuery>> queries) INTERNAL: Set the named queries.void
setQueryBuilder
(JPAQueryBuilder queryBuilder) INTERNAL Set the query builder used to parser JPQL.void
setQueryTimeoutDefault
(int queryTimeoutDefault) PUBLIC: Set the default query timeout for this session.void
setQueryTimeoutUnitDefault
(TimeUnit queryTimeoutUnitDefault) PUBLIC: Set the default query timeout units for this session.void
setRefreshMetadataListener
(MetadataRefreshListener metadatalistener) void
setSerializer
(Serializer serializer) Set the Serializer to use by default for serialization.void
setSessionLog
(SessionLog sessionLog) PUBLIC: Set the session log to which an accessor logs messages and SQL.void
setShouldOptimizeResultSetAccess
(boolean shouldOptimizeResultSetAccess) ADVANCED: Set to indicate whether ObjectLevelReadQuery should by default use ResultSet Access optimization.void
setShouldPropagateChanges
(boolean choice) ADVANCED: Set whether changes should be propagated to other sessions or applications in a EclipseLink cluster through the Remote Command Manager mechanism.void
setSynchronized
(boolean synched) INTERNAL: Set isSynchronized flag to indicate that this session is synchronized.void
setTolerateInvalidJPQL
(boolean b) ADVANCED: Indicates whether an invalid NamedQuery will be tolerated at init time.protected void
setTransactionMutex
(ConcurrencyManager transactionMutex) void
setWasJTSTransactionInternallyStarted
(boolean wasJTSTransactionInternallyStarted) INTERNAL: Return if a JTS transaction was started by the session.void
PUBLIC:boolean
PUBLIC: Return true if SQL logging should log visible bind parameters.boolean
PUBLIC:boolean
PUBLIC: Return if logging is enabled (false if log level is OFF)boolean
shouldLogMessages
(int logLevel) INTERNAL: RemoteCommandManager method.boolean
ADVANCED: Indicates whether ObjectLevelReadQuery should by default use ResultSet Access optimization.boolean
PUBLIC: Return whether changes should be propagated to other sessions or applications in a EclipseLink cluster through the Remote Command Manager mechanism.boolean
ADVANCED: Indicates whether an invalid NamedQuery will be tolerated at init time.void
startOperationProfile
(String operationName) INTERNAL: Start the operation timing.void
startOperationProfile
(String operationName, DatabaseQuery query, int weight) INTERNAL: Start the operation timing.toString()
Print the connection status with the session.unwrapObject
(Object proxy) INTERNAL: Unwrap the object if required.updateObject
(Object domainObject) PUBLIC: Update the object and all of its privately owned parts in the database.void
updateProfile
(String operationName, Object value) INTERNAL: Updates the value of SessionProfiler statevoid
updateTablePerTenantDescriptors
(String property, Object value) INTERNAL: Set the table per tenant.void
ADVANCED: This can be used to help debugging an object identity problem.void
validateQuery
(DatabaseQuery query) INTERNAL: This method will be used to update the query with any settings required For this session.boolean
verifyDelete
(Object domainObject) TESTING: This is used by testing code to ensure that a deletion was successful.void
PUBLIC:boolean
INTERNAL: Return if a JTS transaction was started by the session.wrapObject
(Object implementation) INTERNAL: Wrap the object if required.protected void
writeAllObjectsWithChangeSet
(UnitOfWorkChangeSet uowChangeSet) INTERNAL: Write all of the objects and all of their privately owned parts in the database.writeObject
(Object domainObject) PUBLIC: Write the object and all of its privately owned parts in the database.void
INTERNAL: This method notifies the accessor that a particular sets of writes has completed.
-
Field Details
-
exceptionHandler
ExceptionHandler handles database exceptions. -
integrityChecker
IntegrityChecker catch all the descriptor Exceptions. -
project
The project stores configuration information, such as the descriptors and login. -
transactionMutex
Ensure mutual exclusion of the session's transaction state across multiple threads. -
identityMapAccessor
Manages the live object cache. -
wasJTSTransactionInternallyStarted
protected boolean wasJTSTransactionInternallyStartedIf Transactions were externally started -
accessors
The connection to the data store. -
platform
Allow the datasource platform to be cached. -
queries
Stores predefine reusable queries. -
attributeGroups
Stores predefined reusable AttributeGroups. -
jpaQueriesProcessed
protected boolean jpaQueriesProcessedStores predefined not yet parsed JPQL queries. -
commitManager
Resolves referential integrity on commits. -
profiler
Tool that log performance information. -
broker
Support being owned by a session broker. -
name
Used to identify a session when using the session broker. -
numberOfActiveUnitsOfWork
protected transient int numberOfActiveUnitsOfWorkKeep track of active units of work. -
objectsLockedForClone
This collection will be used to store those objects that are currently locked for the clone process. It should be populated with an EclipseLinkIdentityHashMap -
sessionLog
Destination for logged messages and SQL. -
logSessionString
When logging the name of the session is typed: class name + system hashcode. -
eventManager
Stores the event listeners for this session. -
properties
Allow for user defined properties. -
externalTransactionController
Delegate that handles synchronizing a UnitOfWork with an external transaction. -
lastDescriptorAccessed
Last descriptor accessed, use to optimize descriptor lookup. -
descriptors
PERF: cache descriptors from project. -
tablePerTenantDescriptors
PERF: cache table per tenant descriptors needing to be initialized per EM -
tablePerTenantQueries
PERF: cache table per tenant queries needing to be initialized per EM -
isInBroker
protected boolean isInBrokerUsed to determine If a session is in a Broker or not -
commandManager
Used to connect this session to EclipseLink cluster for distributed command -
shouldCheckWriteLock
protected boolean shouldCheckWriteLockPERF: Cache the write-lock check to avoid cost of checking in every register/clone. -
shouldPropagateChanges
protected boolean shouldPropagateChangesDetermined whether changes should be propagated to an EclipseLink cluster -
isInProfile
protected boolean isInProfileUsed to determine If a session is in a profile or not -
isLoggingOff
protected boolean isLoggingOffPERF: Quick check if logging is OFF entirely. -
isFinalizersEnabled
protected boolean isFinalizersEnabledPERF: Allow for finalizers to be enabled, currently enables client-session finalize. -
activeCommandThreads
List of active command threads. -
isSynchronized
protected boolean isSynchronizedIndicates whether the session is synchronized. In case external transaction controller is used isSynchronized==true means the session's jta connection will be freed during external transaction callback. -
defaultReferenceMode
Stores the default reference mode that a UnitOfWork will use when referencing managed objects.- See Also:
-
pessimisticLockTimeoutDefault
Default pessimistic lock timeout value. -
pessimisticLockTimeoutUnitDefault
-
queryTimeoutDefault
protected int queryTimeoutDefault -
queryTimeoutUnitDefault
-
isConcurrent
protected boolean isConcurrentAllow a session to enable concurrent processing. -
staticMetamodelClasses
This map will hold onto class to static metamodel class references from JPA. -
deferredEvents
temporarily holds a list of events that must be fired after the current operation completes. Initialy created for postClone events. -
isExecutingEvents
protected boolean isExecutingEventsrecords that the UOW is executing deferred events. Events could cause operations to occur that may attempt to restart the event execution. This must be avoided -
partitioningPolicy
Allow queries to be targeted at specific connection pools. -
metadatalistener
the MetadataRefreshListener is used with RCM to force a refresh of the metadata used within EntityManagerFactoryWrappers -
multitenantContextProperties
Stores the set of multitenant context properties this session requires -
queryBuilder
Store the query builder used to parse JPQL. -
serializer
Set the Serializer to use by default for serialization. -
injectionManager
Allow CDI injection of entity listeners -
shouldOptimizeResultSetAccess
protected boolean shouldOptimizeResultSetAccessIndicates whether ObjectLevelReadQuery should by default use ResultSet Access optimization. Optimization specified by the session is ignored if incompatible with other query settings. -
tolerateInvalidJPQL
protected boolean tolerateInvalidJPQLIndicates whether Session creation should tolerate an invalid NamedQuery. If true, an exception will be thrown on .createNamedQuery(..) rather than at init time.
-
-
Constructor Details
-
AbstractSession
protected AbstractSession()INTERNAL: Create and return a new session. This should only be called if the database login information is not know at the time of creation. Normally it is better to call the constructor that takes the login information as an argument so that the session can initialize itself to the platform information given in the login. -
AbstractSession
protected AbstractSession(int nothing) INTERNAL: Create a blank session, used for proxy session. -
AbstractSession
PUBLIC: Create and return a new session. By giving the login information on creation this allows the session to initialize itself to the platform given in the login. This constructor does not return a connected session. To connect the session to the database login() must be sent to it. The login(userName, password) method may also be used to connect the session, this allows for the user name and password to be given at login but for the other database information to be provided when the session is created. -
AbstractSession
PUBLIC: Create and return a new session. This constructor does not return a connected session. To connect the session to the database login() must be sent to it. The login(userName, password) method may also be used to connect the session, this allows for the user name and password to be given at login but for the other database information to be provided when the session is created.
-
-
Method Details
-
getSerializer
Return the Serializer to use by default for serialization.- Specified by:
getSerializer
in interfaceSession
-
setSerializer
Set the Serializer to use by default for serialization.- Specified by:
setSerializer
in interfaceSession
-
getQueryBuilder
INTERNAL Return the query builder used to parser JPQL. -
setQueryBuilder
INTERNAL Set the query builder used to parser JPQL. -
buildDefaultQueryBuilder
INTERNAL Build the JPQL builder based on session properties. -
setLoggingOff
public void setLoggingOff(boolean loggingOff) INTERNAL: PERF: Used for quick turning logging ON/OFF entirely.- Parameters:
loggingOff
- Logging is turned off whentrue
and turned on whenfalse
.
-
isLoggingOff
public boolean isLoggingOff()INTERNAL: PERF: Used for quick check if logging is OFF entirely. -
getNextQueryId
public long getNextQueryId()INTERNAL: Called by a sessions queries to obtain individual query ids. CR #2698903 -
acquireNonSynchronizedUnitOfWork
INTERNAL: Return a unit of work for this session not registered with the JTS transaction. -
acquireNonSynchronizedUnitOfWork
INTERNAL: Return a unit of work for this session not registered with the JTS transaction. -
acquireHistoricalSession
INTERNAL: Constructs a HistoricalSession given a valid AsOfClause.- Specified by:
acquireHistoricalSession
in interfaceSession
- Parameters:
clause
- Represents a valid snap shot time.- Throws:
ValidationException
- ifthis
not a ClientSession, plain Session, or SessionBroker.- See Also:
-
acquireUnitOfWork
PUBLIC: Return a unit of work for this session. The unit of work is an object level transaction that allows a group of changes to be applied as a unit.- Specified by:
acquireUnitOfWork
in interfaceSession
- See Also:
-
acquireRepeatableWriteUnitOfWork
PUBLIC: Return a repeatable write unit of work for this session. A repeatable write unit of work allows multiple writeChanges (flushes).- See Also:
-
acquireUnitOfWork
PUBLIC: Return a unit of work for this session. The unit of work is an object level transaction that allows a group of changes to be applied as a unit.- Specified by:
acquireUnitOfWork
in interfaceSession
- Parameters:
referenceMode
- The reference type the UOW should use internally when referencing Working clones. Setting this to WEAK means the UOW will use weak references to reference clones that support active object change tracking and hard references for deferred change tracked objects. Setting to FORCE_WEAK means that all objects will be referenced by weak references and if the application no longer references the clone the clone may be garbage collected. If the clone has uncommitted changes then those changes will be lost.- See Also:
-
addAlias
PUBLIC: Add an alias for the descriptor -
addJPAQuery
INTERNAL: Return all pre-defined not yet parsed EJBQL queries.- Specified by:
addJPAQuery
in interfaceSession
-
addJPATablePerTenantQuery
INTERNAL: Return all pre-defined not yet parsed EJBQL multitenant queries. -
addMultitenantContextProperty
PUBLIC: Return a set of multitenant context properties this session -
addQuery
INTERNAL: Add the query to the session queries. -
addQuery
PUBLIC: Add the query to the session queries with the given name. This allows for common queries to be pre-defined, reused and executed by name. -
addQuery
PUBLIC: Add the query to the session queries with the given name. This allows for common queries to be pre-defined, reused and executed by name. -
addStaticMetamodelClass
INTERNAL: Add a metamodel class to model class reference. -
addTablePerTenantDescriptor
INTERNAL: Add a descriptor that is uses a table per tenant multitenant policy. -
addTablePerTenantQuery
INTERNAL: Add a query that queries a table per tenant entity -
basicBeginTransaction
INTERNAL: Called by beginTransaction() to start a transaction. This starts a real database transaction. Allows retry if the connection is dead.- Throws:
DatabaseException
-
basicBeginTransaction
INTERNAL: Called by beginTransaction() to start a transaction. This starts a real database transaction. Allows retry if the connection is dead.- Throws:
DatabaseException
-
retryTransaction
public DatabaseException retryTransaction(Accessor accessor, DatabaseException databaseException, int retryCount, AbstractSession executionSession) INTERNAL: A begin transaction failed. Re-connect and retry the begin transaction. -
releaseJTSConnection
public void releaseJTSConnection()INTERNAL: Called in the end of beforeCompletion of external transaction synchronization listener. Close the managed sql connection corresponding to the external transaction, if applicable releases accessor. -
basicCommitTransaction
INTERNAL: Called by commitTransaction() to commit a transaction. This commits the active transaction.- Throws:
DatabaseException
-
basicRollbackTransaction
INTERNAL: Called by rollbackTransaction() to rollback a transaction. This rolls back the active transaction.- Throws:
DatabaseException
-
beginExternalTransaction
public boolean beginExternalTransaction()INTERNAL: Attempts to begin an external transaction. Returns true only in one case - external transaction has been internally started during this method call: wasJTSTransactionInternallyStarted()==false in the beginning of this method and wasJTSTransactionInternallyStarted()==true in the end of this method. -
beginTransaction
PUBLIC: Begin a transaction on the database. This allows a group of database modification to be committed or rolled back as a unit. All writes/deletes will be sent to the database be will not be visible to other users until commit. Although databases do not allow nested transaction, EclipseLink supports nesting through only committing to the database on the outer commit.- Throws:
DatabaseException
- if the database connection is lost or the begin is rejected.ConcurrencyException
- if this session's transaction is acquired by another thread and a timeout occurs.- See Also:
-
checkHierarchyForDescriptor
Check to see if the descriptor of a superclass can be used to describe this class- Returns:
- ClassDescriptor
-
cleanUpInjectionManager
public void cleanUpInjectionManager()allow the entity listener injection manager to clean itself up. -
clearIntegrityChecker
public void clearIntegrityChecker()PUBLIC: clear the integrityChecker. IntegrityChecker holds all the ClassDescriptor Exceptions.- Specified by:
clearIntegrityChecker
in interfaceSession
-
clearLastDescriptorAccessed
public void clearLastDescriptorAccessed()INTERNAL: Clear the the lastDescriptorAccessed cache. -
clearDescriptors
public void clearDescriptors()INTERNAL: Clear the the descriptors cache. -
clearProfile
public void clearProfile()PUBLIC: Clear the profiler, this will end the current profile operation.- Specified by:
clearProfile
in interfaceSession
-
clone
INTERNAL: Clones the descriptor -
commitExternalTransaction
public boolean commitExternalTransaction()INTERNAL: Attempts to commit the running internally started external transaction. Returns true only in one case - external transaction has been internally committed during this method call: wasJTSTransactionInternallyStarted()==true in the beginning of this method and wasJTSTransactionInternallyStarted()==false in the end of this method. -
commitTransaction
PUBLIC: Commit the active database transaction. This allows a group of database modification to be committed or rolled back as a unit. All writes/deletes will be sent to the database be will not be visible to other users until commit. Although databases do not allow nested transaction, EclipseLink supports nesting through only committing to the database on the outer commit.- Throws:
DatabaseException
- most databases validate changes as they are done, normally errors do not occur on commit unless the disk fails or the connection is lost.ConcurrencyException
- if this session is not within a transaction.
-
compareObjects
INTERNAL: Return if the two object match completely. This checks the objects attributes and their private parts. -
compareObjectsDontMatch
TESTING: Return true if the object do not match. This checks the objects attributes and their private parts. -
containsQuery
PUBLIC: Return true if the pre-defined query is defined on the session.- Specified by:
containsQuery
in interfaceSession
-
copy
PUBLIC: Return a complete copy of the object or of collection of objects. In case of collection all members should be either entities of the same type or have a common inheritance hierarchy mapped root class. This can be used to obtain a scratch copy of an object, or for templatizing an existing object into another new object. The object and all of its privately owned parts will be copied. -
copy
PUBLIC: Return a complete copy of the object or of collection of objects. In case of collection all members should be either entities of the same type or have a common inheritance hierarchy mapped root class. This can be used to obtain a scratch copy of an object, or for templatizing an existing object into another new object. If there are no attributes in the group then the object and all of its privately owned parts will be copied. Otherwise only the attributes included into the group will be copied. -
copyInternal
INTERNAL: -
copyReadOnlyClasses
INTERNAL: Copy the read only classes from the unit of work Added Nov 8, 2000 JED for Patch 2.5.1.8 Ref: Prs 24502 -
createCloneQueryValueHolder
public <T> DatabaseValueHolder<T> createCloneQueryValueHolder(ValueHolderInterface<T> attributeValue, Object clone, AbstractRecord row, ForeignReferenceMapping mapping) -
createCloneTransformationValueHolder
public <T> DatabaseValueHolder<T> createCloneTransformationValueHolder(ValueHolderInterface<T> attributeValue, Object original, Object clone, AbstractTransformationMapping mapping) -
createInjectionManager
-
createProtectedInstanceFromCachedData
public Object createProtectedInstanceFromCachedData(Object cached, Integer refreshCascade, ClassDescriptor descriptor) INTERNAL: This method is similar to getAndCloneCacheKeyFromParent. It purpose is to get protected cache data from the shared cache and build/return a protected instance. -
checkAndRefreshInvalidObject
public void checkAndRefreshInvalidObject(Object object, CacheKey cacheKey, ClassDescriptor descriptor) INTERNAL: Check if the object is invalid and refresh it. This is used to ensure that no invalid objects are registered. -
isConsideredInvalid
INTERNAL: Check if the object is invalid and *should* be refreshed. This is used to ensure that no invalid objects are cloned. -
deferEvent
INTERNAL: Add an event to the deferred list. Events will be fired after the operation completes -
deleteAllObjects
public void deleteAllObjects(Collection domainObjects) throws DatabaseException, OptimisticLockException PUBLIC: delete all of the objects and all of their privately owned parts in the database. The allows for a group of objects to be deleted as a unit. The objects will be deleted through a single transactions.- Throws:
DatabaseException
- if an error occurs on the database, these include constraint violations, security violations and general database errors.OptimisticLockException
- if the object's descriptor is using optimistic locking and the object has been updated or deleted by another user since it was last read.
-
deleteObject
PUBLIC: Delete the object and all of its privately owned parts from the database. The delete operation can be customized through using a delete query.- Throws:
DatabaseException
- if an error occurs on the database, these include constraint violations, security violations and general database errors. An database error is not raised if the object is already deleted or no rows are effected.OptimisticLockException
- if the object's descriptor is using optimistic locking and the object has been updated or deleted by another user since it was last read.- See Also:
-
doesObjectExist
PUBLIC: Return if the object exists on the database or not. This always checks existence on the database.- Specified by:
doesObjectExist
in interfaceSession
- Throws:
DatabaseException
-
dontLogMessages
public void dontLogMessages()PUBLIC: Turn off logging- Specified by:
dontLogMessages
in interfaceSession
-
endOperationProfile
INTERNAL: End the operation timing.- Specified by:
endOperationProfile
in interfaceCommandProcessor
-
endOperationProfile
INTERNAL: End the operation timing. -
updateProfile
INTERNAL: Updates the value of SessionProfiler state- Specified by:
updateProfile
in interfaceCommandProcessor
-
updateTablePerTenantDescriptors
INTERNAL: Set the table per tenant. This should be called per client session after the start of a transaction. From JPA this method is called on the entity manager by setting the multitenant table per tenant property. -
incrementProfile
INTERNAL: Updates the count of SessionProfiler event- Specified by:
incrementProfile
in interfaceCommandProcessor
-
incrementProfile
INTERNAL: Updates the count of SessionProfiler event -
executeDeferredEvents
public void executeDeferredEvents()INTERNAL: Causes any deferred events to be fired. Called after operation completes -
executeCall
public Object executeCall(Call call, AbstractRecord translationRow, DatabaseQuery query) throws DatabaseException INTERNAL: Overridden by subclasses that do more than just execute the call. Executes the call directly on this session and does not check which session it should have executed on.- Throws:
DatabaseException
-
releaseConnectionAfterCall
INTERNAL: Release (if required) connection after call. -
executeNonSelectingCall
PUBLIC: Execute the call on the database. The row count is returned. The call can be a stored procedure call, SQL call or other type of call.Example:
session.executeNonSelectingCall(new SQLCall("Delete from Employee");
- Specified by:
executeNonSelectingCall
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
executeNonSelectingSQL
PUBLIC: Execute the sql on the database.Example:
session.executeNonSelectingSQL("Delete from Employee");
- Specified by:
executeNonSelectingSQL
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
executeQuery
PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse.- Specified by:
executeQuery
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
executeQuery
PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse. The class is the descriptor in which the query was pre-defined.- Specified by:
executeQuery
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
executeQuery
public Object executeQuery(String queryName, Class<?> domainClass, Object arg1) throws DatabaseException PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse. The class is the descriptor in which the query was pre-defined.- Specified by:
executeQuery
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
executeQuery
public Object executeQuery(String queryName, Class<?> domainClass, Object arg1, Object arg2) throws DatabaseException PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse. The class is the descriptor in which the query was pre-defined.- Specified by:
executeQuery
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
executeQuery
public Object executeQuery(String queryName, Class<?> domainClass, Object arg1, Object arg2, Object arg3) throws DatabaseException PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse. The class is the descriptor in which the query was pre-defined.- Specified by:
executeQuery
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
executeQuery
public Object executeQuery(String queryName, Class<?> domainClass, List argumentValues) throws DatabaseException PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse. The class is the descriptor in which the query was pre-defined.- Specified by:
executeQuery
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
executeQuery
public Object executeQuery(String queryName, Class<?> domainClass, Vector argumentValues) throws DatabaseException PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse. The class is the descriptor in which the query was pre-defined.- Throws:
DatabaseException
- See Also:
-
executeQuery
PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse.- Specified by:
executeQuery
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
executeQuery
PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse.- Specified by:
executeQuery
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
executeQuery
public Object executeQuery(String queryName, Object arg1, Object arg2, Object arg3) throws DatabaseException PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse.- Specified by:
executeQuery
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
executeQuery
PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse.- Specified by:
executeQuery
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
executeQuery
PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse.- Throws:
DatabaseException
- See Also:
-
executeQuery
PUBLIC: Execute the database query. A query is a database operation such as reading or writing. The query allows for the operation to be customized for such things as, performance, depth, caching, etc.- Specified by:
executeQuery
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
executeQuery
PUBLIC: Return the results from executing the database query. The query arguments are passed in as a List of argument values in the same order as the query arguments.- Specified by:
executeQuery
in interfaceSession
- Throws:
DatabaseException
-
executeQuery
INTERNAL: Return the results from executing the database query. the arguments should be a database row with raw data values.- Throws:
DatabaseException
-
executeQuery
public Object executeQuery(DatabaseQuery query, AbstractRecord row, int retryCount) throws DatabaseException INTERNAL: Return the results from executing the database query. the arguments should be a database row with raw data values.- Throws:
DatabaseException
-
retryQuery
public Object retryQuery(DatabaseQuery query, AbstractRecord row, DatabaseException databaseException, int retryCount, AbstractSession executionSession) INTERNAL: A query execution failed due to an invalid query. Re-connect and retry the query. -
executeSelectingCall
PUBLIC: Execute the call on the database and return the result. The call must return a value, if no value is return executeNonSelectCall must be used. The call can be a stored procedure call, SQL call or other type of call. A vector of database rows is returned, database row implements Java 2 Map which should be used to access the data.Example:
session.executeSelectingCall(new SQLCall("Select * from Employee");
- Specified by:
executeSelectingCall
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
executeSQL
PUBLIC: Execute the sql on the database and return the result. It must return a value, if no value is return executeNonSelectingSQL must be used. A vector of database rows is returned, database row implements Java 2 Map which should be used to access the data. Warning: Allowing an unverified SQL string to be passed into this method makes your application vulnerable to SQL injection attacks.Example:
session.executeSelectingCall("Select * from Employee");
- Specified by:
executeSQL
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
getAccessor
INTERNAL: This should normally not be used, most sessions do not have a single accessor. ServerSession has a set of connection pools. ClientSession only has an accessor during a transaction. SessionBroker has multiple accessors. getAccessors() should be used to support partitioning. To maintain backward compatibility, and to support certain cases that required a default accessor, this returns the first accessor. -
getAccessors
INTERNAL: This should normally not be used, most sessions do not have specific accessors. ServerSession has a set of connection pools. ClientSession only has an accessor during a transaction. SessionBroker has multiple accessors. getAccessors() is used to support partitioning. If the accessor is null, this lazy initializes one for backwardcompatibility with DatabaseSession. -
getAccessors
public Collection<Accessor> getAccessors(Call call, AbstractRecord translationRow, DatabaseQuery query) INTERNAL: Return the connections to use for the query execution. -
basicExecuteCall
public Object basicExecuteCall(Call call, AbstractRecord translationRow, DatabaseQuery query) throws DatabaseException INTERNAL: Execute the call on each accessors and merge the results.- Throws:
DatabaseException
-
getActiveCommandThreads
INTERNAL: -
getActiveSession
PUBLIC: Return the active session for the current active external (JTS) transaction. This should only be used with JTS and will return the session if no external transaction exists.- Specified by:
getActiveSession
in interfaceSession
-
getActiveUnitOfWork
PUBLIC: Return the active unit of work for the current active external (JTS) transaction. This should only be used with JTS and will return null if no external transaction exists.- Specified by:
getActiveUnitOfWork
in interfaceSession
-
getAliasDescriptors
INTERNAL: Returns the alias descriptors Map. -
getAsOfClause
ADVANCED: Answers the past time this session is as of. Indicates whether or not this is a special historical session where all objects are read relative to a particular point in time.- Specified by:
getAsOfClause
in interfaceSession
- Returns:
- An immutable object representation of the past time.
null
if no clause set, or this a regular session. - See Also:
-
getBroker
INTERNAL: Allow the session to be used from a session broker. -
getRootSession
INTERNAL: The session that this query is executed against when not in transaction. The session containing the shared identity map.In most cases this is the root ServerSession or DatabaseSession.
In cases where objects are not to be cached in the global identity map an alternate session may be returned:
- A ClientSession if in transaction
- An isolated ClientSession or HistoricalSession
- A registered session of a root SessionBroker
-
getParent
INTERNAL: Gets the parent session. -
getParentIdentityMapSession
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. -
getParentIdentityMapSession
public 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.Used for session broker which delegates to registered sessions, or UnitOfWork which checks parent identity map also.
- Parameters:
canReturnSelf
- true when method calls itself. If the path starting atthis
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.- Returns:
- this if there is no next link in the chain
-
getParentIdentityMapSession
public AbstractSession getParentIdentityMapSession(ClassDescriptor descriptor, boolean canReturnSelf, boolean terminalOnly) INTERNAL: Returns the appropriate IdentityMap session for this descriptor. Sessions can be chained and each session can have its own Cache/IdentityMap. Entities can be stored at different levels based on Cache Isolation. This method will return the correct Session for a particular Entity class based on the Isolation Level and the attributes provided.- Parameters:
canReturnSelf
- true when method calls itself. If the path starting atthis
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 last session in the chain where the Enitity is stored.- Returns:
- Session with the required IdentityMap
-
getPessimisticLockTimeoutDefault
INTERNAL: Returns the default pessimistic lock timeout value. -
getPessimisticLockTimeoutUnitDefault
-
getQueryTimeoutDefault
public int getQueryTimeoutDefault()PUBLIC: Return the default query timeout for this session. This timeout will apply to any queries that do not have a timeout set, and that do not have a default timeout defined in their descriptor. -
getQueryTimeoutUnitDefault
-
getInjectionManager
-
getExecutionSession
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.
- Parameters:
query
- may store session name or reference class for brokers case- Returns:
- a session with a live accessor
-
hasCommitManager
public boolean hasCommitManager()INTERNAL: Return if the commit manager has been set. -
getCommitManager
INTERNAL: The commit manager is used to resolve referential integrity on commits of multiple objects. All brokered sessions share the same commit manager. -
getDefaultReadOnlyClasses
INTERNAL: Returns the set of read-only classes that gets assigned to each newly created UnitOfWork.- See Also:
-
getClassDescriptor
ADVANCED: Return the descriptor specified for the class. If the class does not have a descriptor but implements an interface that is also implemented by one of the classes stored in the map, that descriptor will be stored under the new class. If a descriptor does not exist for the Class parameter, null is returned. If the passed Class parameter is null, then null will be returned.- Specified by:
getClassDescriptor
in interfaceSession
-
getClassDescriptor
ADVANCED: Return the descriptor specified for the object's class. If a descriptor does not exist for the Object parameter, null is returned. If the passed Object parameter is null, then null will be returned.- Specified by:
getClassDescriptor
in interfaceSession
-
getClassDescriptorForAlias
PUBLIC: Return the descriptor for the alias. UnitOfWork delegates this to the parent- Specified by:
getClassDescriptorForAlias
in interfaceSession
-
getDescriptor
ADVANCED: Return the descriptor specified for the class. If the class does not have a descriptor but implements an interface that is also implemented by one of the classes stored in the map, that descriptor will be stored under the new class. If the passed Class is null, null will be returned.- Specified by:
getDescriptor
in interfaceCoreSession<ClassDescriptor,
Login, Platform, Project, SessionEventManager> - Specified by:
getDescriptor
in interfaceSession
-
getDescriptor
ADVANCED: Return the descriptor specified for the object's class. If the passed Object is null, null will be returned.- Specified by:
getDescriptor
in interfaceCoreSession<ClassDescriptor,
Login, Platform, Project, SessionEventManager> - Specified by:
getDescriptor
in interfaceSession
-
getDescriptorForAlias
PUBLIC: Return the descriptor for the alias.- Specified by:
getDescriptorForAlias
in interfaceSession
- Parameters:
alias
- The descriptor alias.- Returns:
- The descriptor for the alias or
null
if no descriptor was found.
-
getDescriptors
ADVANCED: Return all registered descriptors.- Specified by:
getDescriptors
in interfaceCoreSession<ClassDescriptor,
Login, Platform, Project, SessionEventManager> - Specified by:
getDescriptors
in interfaceSession
- Specified by:
getDescriptors
in classCoreAbstractSession<ClassDescriptor,
Login, Platform, Project, SessionEventManager>
-
hasEventManager
public boolean hasEventManager()INTERNAL: Return if an event manager has been set. -
getEventManager
PUBLIC: Return the event manager. The event manager can be used to register for various session events.- Specified by:
getEventManager
in interfaceCoreSession<ClassDescriptor,
Login, Platform, Project, SessionEventManager> - Specified by:
getEventManager
in interfaceSession
-
getExceptionHandlerClass
INTERNAL: Return a string which represents my ExceptionHandler's class Added for F2104: Properties.xml - gn -
getExceptionHandler
PUBLIC: Return the ExceptionHandler.Exception handler can catch errors that occur on queries or during database access.- Specified by:
getExceptionHandler
in interfaceSession
-
getExternalTransactionController
PUBLIC: Used for JTS integration. If your application requires to have JTS control transactions instead of EclipseLink an external transaction controller must be specified. EclipseLink provides JTS controllers for several JTS implementations including JTS 1.0, Weblogic 5.1 and WebSphere 3.0.- Specified by:
getExternalTransactionController
in interfaceSession
- See Also:
-
getIdentityMapAccessor
PUBLIC: The IdentityMapAccessor is the preferred way of accessing IdentityMap funcitons This will return an object which implements an interface which exposes all public IdentityMap functions.- Specified by:
getIdentityMapAccessor
in interfaceSession
-
getIdentityMapAccessorInstance
INTERNAL: Return the internally available IdentityMapAccessor instance. -
getIntegrityChecker
PUBLIC: Returns the integrityChecker.IntegrityChecker holds all the ClassDescriptor Exceptions.- Specified by:
getIntegrityChecker
in interfaceSession
-
getJPAQueries
ADVANCED: Return all pre-defined not yet parsed JPQL queries.- Specified by:
getJPAQueries
in interfaceSession
-
getJPATablePerTenantQueries
ADVANCED: Return all pre-defined not yet parsed JPQL queries. -
getLog
PUBLIC: Return the writer to which an accessor writes logged messages and SQL. If not set, this reference defaults to a writer on System.out. To enable logging, logMessages must be turned on. -
getLogSessionString
INTERNAL: Return the name of the session: class name + system hashcode.This should be the implementation of toString(), and also the value should be calculated in the constructor for it is used all the time. However everything is lazily initialized now and the value is transient for the system hashcode could vary?
-
getSessionTypeString
INTERNAL: Returns the type of session, its class.Override to hide from the user when they are using an internal subclass of a known class.
A user does not need to know that their UnitOfWork is a non-deferred UnitOfWork, or that their ClientSession is an IsolatedClientSession.
-
getStaticMetamodelClass
INTERNAL: Return the static metamodel class associated with the given model class if available. Callers must handle null. -
getLogin
OBSOLETE: Return the login, the login holds any database connection information given. This has been replaced by getDatasourceLogin to make use of the Login interface to support non-relational datasources, if DatabaseLogin API is required it will need to be cast. -
getDatasourceLogin
PUBLIC: Return the login, the login holds any database connection information given. This return the Login interface and may need to be cast to the datasource specific implementation.- Specified by:
getDatasourceLogin
in interfaceCoreSession<ClassDescriptor,
Login, Platform, Project, SessionEventManager> - Specified by:
getDatasourceLogin
in interfaceSession
-
getMappedSuperclass
INTERNAL: Return the mapped superclass descriptor if one exists for the given class name. Must check any broker as well. -
getMultitenantContextProperties
PUBLIC: Return a set of multitenant context properties this session -
getName
PUBLIC: Return the name of the session. This is used with the session broker, or to give the session a more meaningful name. -
getNextSequenceNumberValue
ADVANCED: Return the sequnce number from the database- Specified by:
getNextSequenceNumberValue
in interfaceSession
-
getNumberOfActiveUnitsOfWork
public int getNumberOfActiveUnitsOfWork()INTERNAL: Return the number of units of work connected. -
getCacheKeyFromTargetSessionForMerge
protected CacheKey getCacheKeyFromTargetSessionForMerge(Object implementation, ObjectBuilder builder, ClassDescriptor descriptor, MergeManager mergeManager) INTERNAL: For use within the merge process this method will get an object from the shared cache using a readlock. If a readlock is unavailable then the merge manager will be transitioned to deferred locks and a deferred lock will be used. -
getPlatform
INTERNAL: Return the database platform currently connected to. The platform is used for database specific behavior. NOTE: this must only be used for relational specific usage, it will fail for non-relational datasources.- Specified by:
getPlatform
in interfaceSession
-
getLoader
INTERNAL: Return the class loader for the session's application. This loader should be able to load any application or EclipseLink class. -
getDatasourcePlatform
INTERNAL: Return the database platform currently connected to. The platform is used for database specific behavior.- Specified by:
getDatasourcePlatform
in interfaceCoreSession<ClassDescriptor,
Login, Platform, Project, SessionEventManager> - Specified by:
getDatasourcePlatform
in interfaceSession
- Specified by:
getDatasourcePlatform
in classCoreAbstractSession<ClassDescriptor,
Login, Platform, Project, SessionEventManager>
-
getServerPlatform
INTERNAL: Marked internal as this is not customer API but helper methods for accessing the server platform from within EclipseLink's other sessions types (ie not DatabaseSession)- Specified by:
getServerPlatform
in interfaceSession
-
getPlatform
INTERNAL: Return the database platform currently connected to for specified class. The platform is used for database specific behavior.- Specified by:
getPlatform
in classCoreAbstractSession<ClassDescriptor,
Login, Platform, Project, SessionEventManager>
-
getProfiler
PUBLIC: Return the profiler. The profiler is a tool that can be used to determine performance bottlenecks. The profiler can be queries to print summaries and configure for logging purposes.- Specified by:
getProfiler
in interfaceSession
-
getProject
PUBLIC: Return the project, the project holds configuartion information including the descriptors.- Specified by:
getProject
in interfaceCoreSession<ClassDescriptor,
Login, Platform, Project, SessionEventManager> - Specified by:
getProject
in interfaceSession
-
getProperties
ADVANCED: Allow for user defined properties.- Specified by:
getProperties
in interfaceSession
-
hasProperties
public boolean hasProperties()INTERNAL: Allow to check for user defined properties. -
hasTablePerTenantDescriptors
public boolean hasTablePerTenantDescriptors()INTERNAL: Return list of table per tenant multitenant descriptors. -
hasTablePerTenantQueries
public boolean hasTablePerTenantQueries()INTERNAL: Return a list of table per tenant multitenant queries. -
getProperty
ADVANCED: Returns the user defined property.- Specified by:
getProperty
in interfaceSession
-
getQueries
ADVANCED: Return all pre-defined queries.- Specified by:
getQueries
in interfaceSession
-
getAttributeGroups
ADVANCED Return all predefined attribute groups -
getAllQueries
INTERNAL: Return the pre-defined queries in this session. A single vector containing all the queries is returned.- See Also:
-
getQuery
PUBLIC: Return the query from the session pre-defined queries with the given name. This allows for common queries to be pre-defined, reused and executed by name. -
getQuery
PUBLIC: Return the query from the session pre-defined queries with the given name and argument types. This allows for common queries to be pre-defined, reused and executed by name. This method should be used if the Session has multiple queries with the same name but different arguments. -
getQuery
PUBLIC: Return the query from the session pre-defined queries with the given name and argument types. This allows for common queries to be pre-defined, reused and executed by name. This method should be used if the Session has multiple queries with the same name but different arguments.- See Also:
-
getQuery
INTERNAL: Return the query from the session pre-defined queries with the given name and argument types. This allows for common queries to be pre-defined, reused and executed by name. This method should be used if the Session has multiple queries with the same name but different arguments.- Parameters:
shouldSearchParent
- indicates whether parent should be searched if query not found.- See Also:
-
getSequencing
INTERNAL: Return the Sequencing object used by the session. -
getSessionForClass
INTERNAL: Return the session to be used for the class. Used for compatibility with the session broker. -
getSessionForName
INTERNAL: Return the session by name. Used for compatibility with the session broker.- Throws:
ValidationException
-
getSessionLog
PUBLIC: Return the session log to which an accessor logs messages and SQL. If not set, this will default to a session log on a writer on System.out. To enable logging, logMessages must be turned on.- Specified by:
getSessionLog
in interfaceSession
- See Also:
-
getTablePerTenantDescriptors
INTERNAL: Return list of table per tenant multitenant descriptors. -
getTablePerTenantQueries
INTERNAL: Return list of table per tenant multitenant descriptors. -
getTransactionMutex
INTERNAL: The transaction mutex ensure mutual exclusion on transaction across multiple threads. -
handleException
PUBLIC: Allow any WARNING level exceptions that occur within EclipseLink to be logged and handled by the exception handler.- Specified by:
handleException
in interfaceCommandProcessor
- Specified by:
handleException
in interfaceSession
- Parameters:
exception
- The exception being thrown- Returns:
- An object that is not currently used
- Throws:
RuntimeException
-
hasBroker
public boolean hasBroker()INTERNAL: Allow the session to be used from a session broker. -
hasDescriptor
ADVANCED: Return true if a descriptor exists for the given class.- Specified by:
hasDescriptor
in interfaceSession
-
hasExceptionHandler
public boolean hasExceptionHandler()PUBLIC: Return if an exception handler is present.- Specified by:
hasExceptionHandler
in interfaceSession
-
hasExternalTransactionController
public boolean hasExternalTransactionController()PUBLIC: Used for JTA integration. If your application requires to have JTA control transactions instead of EclipseLink an external transaction controler must be specified. EclipseLink provides JTA controlers for JTA 1.0 and application servers.- Specified by:
hasExternalTransactionController
in interfaceSession
- See Also:
-
initializeIdentityMapAccessor
public void initializeIdentityMapAccessor()INTERNAL: Set up the IdentityMapManager. This method allows subclasses of Session to override the default IdentityMapManager functionality. -
insertObject
PUBLIC: Insert the object and all of its privately owned parts into the database. Insert should only be used if the application knows that the object is new, otherwise writeObject should be used. The insert operation can be customized through using an insert query.- Throws:
DatabaseException
- if an error occurs on the database, these include constraint violations, security violations and general database errors.- See Also:
-
internalExecuteQuery
public Object internalExecuteQuery(DatabaseQuery query, AbstractRecord databaseRow) throws DatabaseException INTERNAL: Return the results from exeucting the database query. The arguments should be a database row with raw data values. This method is provided to allow subclasses to change the default querying behavior. All querying goes through this method.- Throws:
DatabaseException
-
isBroker
public boolean isBroker()INTERNAL: Returns true if the session is a session Broker. -
isInBroker
public boolean isInBroker()INTERNAL: Returns true if the session is in a session Broker. -
isClassReadOnly
PUBLIC: Return if the class is defined as read-only. -
isClassReadOnly
INTERNAL: Return if the class is defined as read-only. PERF: Pass descriptor to avoid re-lookup. -
isClientSession
public boolean isClientSession()PUBLIC: Return if this session is a client session.- Specified by:
isClientSession
in interfaceSession
-
isIsolatedClientSession
public boolean isIsolatedClientSession()PUBLIC: Return if this session is an isolated client session. -
isExclusiveIsolatedClientSession
public boolean isExclusiveIsolatedClientSession()PUBLIC: Return if this session is an exclusive isolated client session. -
isConnected
public boolean isConnected()PUBLIC: Return if this session is connected to the database.- Specified by:
isConnected
in interfaceSession
-
isDatabaseSession
public boolean isDatabaseSession()PUBLIC: Return if this session is a database session.- Specified by:
isDatabaseSession
in interfaceSession
-
isDistributedSession
public boolean isDistributedSession()PUBLIC: Return if this session is a distributed session.- Specified by:
isDistributedSession
in interfaceSession
-
isInProfile
public boolean isInProfile()PUBLIC: Return if a profiler is being used.- Specified by:
isInProfile
in interfaceSession
-
setIsInProfile
public void setIsInProfile(boolean inProfile) PUBLIC: Allow for user deactive a profiler -
setIsInBroker
public void setIsInBroker(boolean isInBroker) INTERNAL: Set if this session is contained in a SessionBroker. -
isFinalizersEnabled
public boolean isFinalizersEnabled()PUBLIC: Return if this session's decendants should use finalizers. The allows certain finalizers such as in ClientSession to be enabled. These are disable by default for performance reasons.- Specified by:
isFinalizersEnabled
in interfaceSession
-
registerFinalizer
public void registerFinalizer()INTERNAL: Register a finalizer to release this session. -
isHistoricalSession
public boolean isHistoricalSession()INTERNAL: Return if this session is a historical session. -
setIsFinalizersEnabled
public void setIsFinalizersEnabled(boolean isFinalizersEnabled) PUBLIC: Set if this session's decendants should use finalizers. The allows certain finalizers such as in ClientSession to be enabled. These are disable by default for performance reasons.- Specified by:
setIsFinalizersEnabled
in interfaceSession
-
isInTransaction
public boolean isInTransaction()PUBLIC: Return if the session is currently in the progress of a database transaction. Because nested transactions are allowed check if the transaction mutex has been aquired. -
isJPAQueriesProcessed
public boolean isJPAQueriesProcessed()INTERNAL: used to see if JPA Queries have been processed during initialization -
isProtectedSession
public boolean isProtectedSession()PUBLIC: Returns true if Protected Entities should be built within this session -
isRemoteSession
public boolean isRemoteSession()PUBLIC: Return if this session is remote.- Specified by:
isRemoteSession
in interfaceSession
-
isRemoteUnitOfWork
public boolean isRemoteUnitOfWork()PUBLIC: Return if this session is a unit of work.- Specified by:
isRemoteUnitOfWork
in interfaceSession
-
isServerSession
public boolean isServerSession()PUBLIC: Return if this session is a server session.- Specified by:
isServerSession
in interfaceSession
-
isSessionBroker
public boolean isSessionBroker()PUBLIC: Return if this session is a session broker.- Specified by:
isSessionBroker
in interfaceSession
-
isSynchronized
public boolean isSynchronized()INTERNAL: Return if this session is synchronized. -
isUnitOfWork
public boolean isUnitOfWork()PUBLIC: Return if this session is a unit of work.- Specified by:
isUnitOfWork
in interfaceSession
-
getId
ADVANCED: Extract and return the primary key from the object.- Specified by:
getId
in interfaceSession
- Throws:
ValidationException
-
keyFromObject
public Object keyFromObject(Object domainObject, ClassDescriptor descriptor) throws ValidationException ADVANCED: Extract and return the primary key from the object.- Throws:
ValidationException
-
log
PUBLIC: Log the log entry. -
logMessage
Log a untranslated message to the EclipseLink log at FINER level.- Specified by:
logMessage
in interfaceSession
-
prepareDatabaseQuery
INTERNAL: A call back to do session specific preparation of a query.The call back occurs soon before we clone the query for execution, meaning that if this method needs to clone the query then the caller will determine that it doesn't need to clone the query itself.
-
readAllObjects
PUBLIC: Read all of the instances of the class from the database. This operation can be customized through using a ReadAllQuery, or through also passing in a selection criteria.- Specified by:
readAllObjects
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
readAllObjects
PUBLIC: Read all of the instances of the class from the database return through execution the SQL string. The SQL string must be a valid SQL select statement or selecting stored procedure call. This operation can be customized through using a ReadAllQuery. Warning: Allowing an unverified SQL string to be passed into this method makes your application vulnerable to SQL injection attacks.- Throws:
DatabaseException
- See Also:
-
readAllObjects
PUBLIC: Read all the instances of the class from the database returned through execution the Call string. The Call can be an SQLCall or JPQLCall. example: session.readAllObjects(Employee.class, new SQLCall("SELECT * FROM EMPLOYEE"));- Specified by:
readAllObjects
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
readAllObjects
PUBLIC: Read all of the instances of the class from the database matching the given expression. This operation can be customized through using a ReadAllQuery.- Specified by:
readAllObjects
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
readObject
PUBLIC: Read the first instance of the class from the database. This operation can be customized through using a ReadObjectQuery, or through also passing in a selection criteria.- Specified by:
readObject
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
readObject
PUBLIC: Read the first instance of the class from the database return through execution the SQL string. The SQL string must be a valid SQL select statement or selecting stored procedure call. This operation can be customized through using a ReadObjectQuery. Warning: Allowing an unverified SQL string to be passed into this method makes your application vulnerable to SQL injection attacks.- Throws:
DatabaseException
- See Also:
-
readObject
PUBLIC: Read the first instance of the class from the database returned through execution the Call string. The Call can be an SQLCall or JPQLCall. example: session.readObject(Employee.class, new SQLCall("SELECT * FROM EMPLOYEE"));- Specified by:
readObject
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
readObject
PUBLIC: Read the first instance of the class from the database matching the given expression. This operation can be customized through using a ReadObjectQuery.- Specified by:
readObject
in interfaceSession
- Throws:
DatabaseException
- See Also:
-
readObject
PUBLIC: Use the example object to consruct a read object query by the objects primary key. This will read the object from the database with the same primary key as the object or null if no object is found.- Specified by:
readObject
in interfaceSession
- Throws:
DatabaseException
-
refreshAndLockObject
PUBLIC: Refresh the attributes of the object and of all of its private parts from the database. The object will be pessimisticly locked on the database for the duration of the transaction. If the object is already locked this method will wait until the lock is released. A no wait option is available through setting the lock mode.- Throws:
DatabaseException
- See Also:
-
refreshAndLockObject
PUBLIC: Refresh the attributes of the object and of all of its private parts from the database. The object will be pessimisticly locked on the database for the duration of the transaction.Lock Modes: ObjectBuildingQuery.NO_LOCK, LOCK, LOCK_NOWAIT
- Throws:
DatabaseException
-
refreshObject
PUBLIC: Refresh the attributes of the object and of all of its private parts from the database. This can be used to ensure the object is up to date with the database. Caution should be used when using this to make sure the application has no un commited changes to the object.- Specified by:
refreshObject
in interfaceSession
- Throws:
DatabaseException
-
release
public void release()PUBLIC: Release the session. This does nothing by default, but allows for other sessions such as the ClientSession to do something. -
releaseUnitOfWork
INTERNAL: Release the unit of work, if lazy release the connection. -
removeProperty
PUBLIC: Remove the user defined property.- Specified by:
removeProperty
in interfaceSession
-
removeQuery
PUBLIC: Remove all queries with the given queryName regardless of the argument types.- Specified by:
removeQuery
in interfaceSession
- See Also:
-
removeQuery
PUBLIC: Remove the specific query with the given queryName and argumentTypes. -
rollbackExternalTransaction
protected boolean rollbackExternalTransaction()PROTECTED: Attempts to rollback the running internally started external transaction. Returns true only in one case - extenal transaction has been internally rolled back during this method call: wasJTSTransactionInternallyStarted()==true in the beginning of this method and wasJTSTransactionInternallyStarted()==false in the end of this method. -
rollbackTransaction
PUBLIC: Rollback the active database transaction. This allows a group of database modification to be commited or rolledback as a unit. All writes/deletes will be sent to the database be will not be visible to other users until commit. Although databases do not allow nested transaction, EclipseLink supports nesting through only committing to the database on the outer commit.- Throws:
DatabaseException
- if the database connection is lost or the rollback fails.ConcurrencyException
- if this session is not within a transaction.
-
setAccessor
INTERNAL: Set the accessor. -
setBroker
INTERNAL: Allow the session to be used from a session broker. -
setCommitManager
INTERNAL: The commit manager is used to resolve referncial integrity on commits of multiple objects. -
setInjectionManager
-
setEventManager
INTERNAL: Set the event manager. The event manager can be used to register for various session events. -
setExceptionHandler
PUBLIC: Set the exceptionHandler. Exception handler can catch errors that occur on queries or during database access.- Specified by:
setExceptionHandler
in interfaceSession
-
setExternalTransactionController
public void setExternalTransactionController(ExternalTransactionController externalTransactionController) Used for JTS integration internally by ServerPlatform.- Specified by:
setExternalTransactionController
in interfaceSession
- See Also:
-
setIntegrityChecker
PUBLIC: set the integrityChecker. IntegrityChecker holds all the ClassDescriptor Exceptions.- Specified by:
setIntegrityChecker
in interfaceSession
-
setJPAQueriesProcessed
public void setJPAQueriesProcessed(boolean jpaQueriesProcessed) INTERNAL: used to set if JPA Queries have been processed during initialization -
setLog
PUBLIC: Set the writer to which an accessor writes logged messages and SQL. If not set, this reference defaults to a writer on System.out. To enable logging logMessages() is used. -
setLogin
PUBLIC: Set the login. -
setLogin
PUBLIC: Set the login. -
setDatasourceLogin
PUBLIC: Set the login. -
setName
PUBLIC: Set the name of the session. This is used with the session broker. -
setNumberOfActiveUnitsOfWork
protected void setNumberOfActiveUnitsOfWork(int numberOfActiveUnitsOfWork) -
setPessimisticLockTimeoutDefault
PUBLIC: Set the default pessimistic lock timeout value. This value will be used to set the WAIT clause of a SQL SELECT FOR UPDATE statement. It defines how long EcliseLink should wait for a lock on the database row before aborting. -
setPessimisticLockTimeoutUnitDefault
-
setQueryTimeoutDefault
public void setQueryTimeoutDefault(int queryTimeoutDefault) PUBLIC: Set the default query timeout for this session. This timeout will apply to any queries that do not have a timeout set, and that do not have a default timeout defined in their descriptor.- Specified by:
setQueryTimeoutDefault
in interfaceSession
-
setQueryTimeoutUnitDefault
Description copied from interface:Session
PUBLIC: Set the default query timeout units for this session. This timeout unit will apply to any queries that do not have a unit value set, and that do not have a default timeout unit defined in their descriptor.- Specified by:
setQueryTimeoutUnitDefault
in interfaceSession
-
setProfiler
PUBLIC: Set the profiler for the session. This allows for performance operations to be profiled.- Specified by:
setProfiler
in interfaceSession
-
setProject
INTERNAL: Set the project, the project holds configuration information including the descriptors. -
setProperties
INTERNAL: Set the user defined properties by shallow copying the propertiesMap. -
setProperty
PUBLIC: Allow for user defined properties.- Specified by:
setProperty
in interfaceSession
-
setQueries
INTERNAL: Set the named queries. -
setSessionLog
PUBLIC: Set the session log to which an accessor logs messages and SQL. If not set, this will default to a session log on a writer on System.out. To enable logging, log level can not be OFF. Also set a backpointer to this session in SessionLog.- Specified by:
setSessionLog
in interfaceSession
- See Also:
-
setSynchronized
public void setSynchronized(boolean synched) INTERNAL: Set isSynchronized flag to indicate that this session is synchronized. This method should only be called by setSynchronized methods of derived classes. -
setTransactionMutex
-
setWasJTSTransactionInternallyStarted
public void setWasJTSTransactionInternallyStarted(boolean wasJTSTransactionInternallyStarted) INTERNAL: Return if a JTS transaction was started by the session. The session will start a JTS transaction if a unit of work or transaction is begun without a JTS transaction present. -
shouldLogMessages
public boolean shouldLogMessages()PUBLIC: Return if logging is enabled (false if log level is OFF)- Specified by:
shouldLogMessages
in interfaceSession
-
startOperationProfile
INTERNAL: Start the operation timing.- Specified by:
startOperationProfile
in interfaceCommandProcessor
-
startOperationProfile
INTERNAL: Start the operation timing. -
toString
Print the connection status with the session. -
unwrapObject
INTERNAL: Unwrap the object if required. This is used for the wrapper policy support and EJB. -
updateObject
PUBLIC: Update the object and all of its privately owned parts in the database. Update should only be used if the application knows that the object is new, otherwise writeObject should be used. The update operation can be customized through using an update query.- Throws:
DatabaseException
- if an error occurs on the database, these include constraint violations, security violations and general database errors.OptimisticLockException
- if the object's descriptor is using optimistic locking and the object has been updated or deleted by another user since it was last read.- See Also:
-
validateCache
public void validateCache()ADVANCED: This can be used to help debugging an object identity problem. An object identity problem is when an object in the cache references an object not in the cache. This method will validate that all cached objects are in a correct state.- Specified by:
validateCache
in interfaceSession
-
validateQuery
INTERNAL: This method will be used to update the query with any settings required For this session. It can also be used to validate execution. -
verifyDelete
TESTING: This is used by testing code to ensure that a deletion was successful. -
wasJTSTransactionInternallyStarted
public boolean wasJTSTransactionInternallyStarted()INTERNAL: Return if a JTS transaction was started by the session. The session will start a JTS transaction if a unit of work or transaction is begun without a JTS transaction present. -
wrapObject
INTERNAL: Wrap the object if required. This is used for the wrapper policy support and EJB. -
writeAllObjectsWithChangeSet
protected void writeAllObjectsWithChangeSet(UnitOfWorkChangeSet uowChangeSet) throws DatabaseException, OptimisticLockException INTERNAL: Write all of the objects and all of their privately owned parts in the database. The allows for a group of new objects to be commited as a unit. The objects will be commited through a single transactions and any foreign keys/circular references between the objects will be resolved. -
writeObject
PUBLIC: Write the object and all of its privately owned parts in the database. Write will determine if an insert or an update should be done, it may go to the database to determine this (by default will check the identity map). The write operation can be customized through using an write query.- Throws:
DatabaseException
- if an error occurs on the database, these include constraint violations, security violations and general database errors.OptimisticLockException
- if the object's descriptor is using optimistic locking and the object has been updated or deleted by another user since it was last read.- See Also:
-
writesCompleted
public void writesCompleted()INTERNAL: This method notifies the accessor that a particular sets of writes has completed. This notification can be used for such thing as flushing the batch mechanism -
processCommand
INTERNAL: RemoteCommandManager method. This is a required method in order to implement the CommandProcessor interface. Process the remote command from the RCM. The command may have come from any remote session or application. Since this is a EclipseLink session we can always assume that the object that we receive here will be a Command object.- Specified by:
processCommand
in interfaceCommandProcessor
- Parameters:
command
- Application formatted command to be processed
-
processJPAQueries
public void processJPAQueries()INTERNAL: Process the JPA named queries into EclipseLink Session queries. This method is called after descriptor initialization. Temporarily made public for ODI. Should not be used elsewhere. -
processJPAQuery
INTERNAL: Process the JPA named query into an EclipseLink Session query. This method is called after descriptor initialization. -
getCommandManager
PUBLIC: Return the CommandManager that allows this session to act as a CommandProcessor and receive or propagate commands from/to the EclipseLink cluster.- Specified by:
getCommandManager
in interfaceCommandProcessor
- Returns:
- The CommandManager instance that controls the remote command service for this session
- See Also:
-
setCommandManager
ADVANCED: Set the CommandManager that allows this session to act as a CommandProcessor and receive or propagate commands from/to the EclipseLink cluster.- Specified by:
setCommandManager
in interfaceCommandProcessor
- Parameters:
mgr
- The CommandManager instance to control the remote command service for this session- See Also:
-
shouldPropagateChanges
public boolean shouldPropagateChanges()PUBLIC: Return whether changes should be propagated to other sessions or applications in a EclipseLink cluster through the Remote Command Manager mechanism. In order for this to occur the CommandManager must be set.- Returns:
- True if propagation is set to occur, false if not
- See Also:
-
setShouldPropagateChanges
public void setShouldPropagateChanges(boolean choice) ADVANCED: Set whether changes should be propagated to other sessions or applications in a EclipseLink cluster through the Remote Command Manager mechanism. In order for this to occur the CommandManager must be set.- Parameters:
choice
- If true (and the CommandManager is set) then propagation will occur- See Also:
-
shouldLogMessages
public boolean shouldLogMessages(int logLevel) INTERNAL: RemoteCommandManager method. This is a required method in order to implement the CommandProcessor interface. Return true if a message at the specified log level would be logged given the log level setting of this session. This can be used by the CommandManager to know whether it should even bother to create the localized strings and call the logMessage method, or if it would only find that the message would not be logged because the session level does not permit logging. The log level passed in will be one of the constants LOG_ERROR, LOG_WARNING, LOG_INFO, and LOG_DEBUG defined in the CommandProcessor interface.- Specified by:
shouldLogMessages
in interfaceCommandProcessor
- Parameters:
logLevel
- A log constant that is one of LOG_ERROR, LOG_WARNING, LOG_INFO, LOG_DEBUG- Returns:
- True if a message at the specified level should be logged and false if it should not
-
logMessage
INTERNAL: RemoteCommandManager method. This is a required method in order to implement the CommandProcessor interface. Log the specified message string at the specified level if it should be logged given the log level setting in this session. The log level passed in will be one of the constants LOG_ERROR, LOG_WARNING, LOG_INFO, and LOG_DEBUG defined in the CommandProcessor interface.- Specified by:
logMessage
in interfaceCommandProcessor
- Parameters:
logLevel
- A log constant that is one of LOG_ERROR, LOG_WARNING, LOG_INFO, LOG_DEBUGmessage
- The message String that is to be logged
-
getLogLevel
PUBLIC:Return the log level
- Specified by:
getLogLevel
in interfaceSession
- Parameters:
category
- the string representation of a EclipseLink category, e.g. "sql", "transaction" ...- Returns:
- the log level
- See Also:
-
getLogLevel
public int getLogLevel()PUBLIC:Return the log level
- Specified by:
getLogLevel
in interfaceSession
- Returns:
- the log level
- See Also:
-
setLogLevel
public void setLogLevel(int level) PUBLIC:Set the log level
- Specified by:
setLogLevel
in interfaceCoreSession<ClassDescriptor,
Login, Platform, Project, SessionEventManager> - Specified by:
setLogLevel
in interfaceSession
- Parameters:
level
- the new log level- See Also:
-
shouldDisplayData
public boolean shouldDisplayData()PUBLIC: Return true if SQL logging should log visible bind parameters. If the shouldDisplayData is not set, check the session log level and return true for a level greater than CONFIG. -
shouldLog
PUBLIC:Check if a message of the given level would actually be logged.
-
log
PUBLIC:Log a message with level and category that needs to be translated.
- Parameters:
level
- the log request level valuecategory
- the string representation of a EclipseLink category.message
- the string message
-
log
PUBLIC:Log a message with level, category and a parameter that needs to be translated.
- Parameters:
level
- the log request level valuecategory
- the string representation of a EclipseLink category.message
- the string messageparam
- a parameter of the message
-
log
PUBLIC:Log a message with level, category and two parameters that needs to be translated.
- Parameters:
level
- the log request level valuecategory
- the string representation of a EclipseLink category.message
- the string messageparam1
- a parameter of the messageparam2
- second parameter of the message
-
log
public void log(int level, String category, String message, Object param1, Object param2, Object param3) PUBLIC:Log a message with level, category and three parameters that needs to be translated.
- Parameters:
level
- the log request level valuecategory
- the string representation of a EclipseLink category.message
- the string messageparam1
- a parameter of the messageparam2
- second parameter of the messageparam3
- third parameter of the message
-
log
PUBLIC:Log a message with level, category and an array of parameters that needs to be translated.
- Parameters:
level
- the log request level valuecategory
- the string representation of a EclipseLink category.message
- the string messageparams
- array of parameters to the message
-
log
PUBLIC:Log a message with level, category, parameters and accessor that needs to be translated.
- Parameters:
level
- the log request level valuecategory
- the string representation of a EclipseLink category.message
- the string messageparams
- array of parameters to the messageaccessor
- the connection that generated the log entry
-
log
public void log(int level, String category, String message, Object[] params, Accessor accessor, boolean shouldTranslate) PUBLIC:Log a message with level, category, parameters and accessor. shouldTranslate determines if the message needs to be translated.
- Parameters:
level
- the log request level valuecategory
- the string representation of a EclipseLink category.message
- the string messageparams
- array of parameters to the messageaccessor
- the connection that generated the log entryshouldTranslate
- true if the message needs to be translated.
-
logThrowable
PUBLIC:Log a throwable with level and category.
- Parameters:
level
- the log request level valuecategory
- the string representation of a EclipseLink category.throwable
- a Throwable
-
severe
PUBLIC:This method is called when a severe level message needs to be logged. The message will be translated
- Parameters:
message
- the message key
-
warning
PUBLIC:This method is called when a warning level message needs to be logged. The message will be translated
- Parameters:
message
- the message key
-
info
PUBLIC:This method is called when a info level message needs to be logged. The message will be translated
- Parameters:
message
- the message key
-
config
PUBLIC:This method is called when a config level message needs to be logged. The message will be translated
- Parameters:
message
- the message key
-
fine
PUBLIC:This method is called when a fine level message needs to be logged. The message will be translated
- Parameters:
message
- the message key
-
finer
PUBLIC:This method is called when a finer level message needs to be logged. The message will be translated
- Parameters:
message
- the message key
-
finest
PUBLIC:This method is called when a finest level message needs to be logged. The message will be translated
- Parameters:
message
- the message key
-
handleSevere
PUBLIC: Allow any SEVERE level exceptions that occur within EclipseLink to be logged and handled by the exception handler.- Specified by:
handleSevere
in interfaceSession
- Throws:
RuntimeException
-
releaseReadConnection
INTERNAL: -
copyDescriptorsFromProject
public void copyDescriptorsFromProject()INTERNAL: Copies descriptors cached on the Project. Used after Project.descriptors has been reset by addDescriptor(s) when the session is connected. -
copyDescriptorNamedQueries
public void copyDescriptorNamedQueries(boolean allowSameQueryNameDiffArgsCopyToSession) INTERNAL: This method will be used to copy all EclipseLink named queries defined in descriptors into the session.- Parameters:
allowSameQueryNameDiffArgsCopyToSession
- if the value is true, it allow multiple queries of the same name but different arguments to be copied to the session.
-
postAcquireConnection
INTERNAL: This method rises appropriate for the session event(s) right after connection is acquired. -
preReleaseConnection
INTERNAL: This method rises appropriate for the session event(s) right before the connection is released. -
priviledgedExecuteNonSelectingCall
INTERNAL: Execute the call on the database. Calling this method will bypass a global setting to disallow native SQL queries. (set by default when one Entity is marked as multitenant) The row count is returned. The call can be a stored procedure call, SQL call or other type of call.Example:
session.executeNonSelectingCall(new SQLCall("Delete from Employee"), true);
- Throws:
DatabaseException
- See Also:
-
priviledgedExecuteSelectingCall
INTERNAL: Execute the call on the database and return the result. Calling this method will bypass a global setting to disallow native SQL queries. (set by default when one Entity is marked as multitenant) The call must return a value, if no value is return executeNonSelectCall must be used. The call can be a stored procedure call, SQL call or other type of call. A vector of database rows is returned, database row implements Java 2 Map which should be used to access the data.Example:
session.executeSelectingCall(new SQLCall("Select * from Employee");
- Throws:
DatabaseException
- See Also:
-
isExclusiveConnectionRequired
public boolean isExclusiveConnectionRequired()INTERNAL: This method is called in case externalConnectionPooling is used. If returns true, accessor used by the session keeps its connection open until released by the session. -
getDefaultReferenceMode
Stores the default Session wide reference mode that a UnitOfWork will use when referencing managed objects.- Specified by:
getDefaultReferenceMode
in interfaceSession
- See Also:
-
setDefaultReferenceMode
Stores the default Session wide reference mode that a UnitOfWork will use when referencing managed objects.- Specified by:
setDefaultReferenceMode
in interfaceSession
- See Also:
-
load
This method will load the passed object or collection of objects using the passed AttributeGroup. In case of collection all members should be either objects of the same mapped type or have a common inheritance hierarchy mapped root class. The AttributeGroup should correspond to the object type. -
load
public void load(Object objectOrCollection, AttributeGroup group, ClassDescriptor referenceDescriptor, boolean fromFetchGroup) This method will load the passed object or collection of objects using the passed AttributeGroup. In case of collection all members should be either objects of the same mapped type or have a common inheritance hierarchy mapped root class. The AttributeGroup should correspond to the object type. -
retrieveCacheKey
public CacheKey retrieveCacheKey(Object primaryKey, ClassDescriptor concreteDescriptor, JoinedAttributeManager joinManager, ObjectBuildingQuery query) -
getPartitioningPolicy
PUBLIC: Return the session's partitioning policy.- Specified by:
getPartitioningPolicy
in interfaceSession
-
setPartitioningPolicy
PUBLIC: Set the session's partitioning policy. A PartitioningPolicy is used to partition, load-balance or replicate data across multiple difference databases or across a database cluster such as Oracle RAC. Partitioning can provide improved scalability by allowing multiple database machines to service requests.- Specified by:
setPartitioningPolicy
in interfaceSession
-
getRefreshMetadataListener
INTERNAL: This currently only used by JPA with RCM to force a refresh of the metadata used within EntityManagerFactoryWrappers -
setRefreshMetadataListener
-
isConcurrent
public boolean isConcurrent()ADVANCED: Return if the session enables concurrent processing. Concurrent processing allow certain processing to be done on seperate threads. This can result in improved performance. This will use the session's server platform's thread pool. -
setIsConcurrent
public void setIsConcurrent(boolean isConcurrent) ADVANCED: Set if the session enables concurrent processing. Concurrent processing allow certain processing to be done on seperate threads. This can result in improved performance. This will use the session's server platform's thread pool. -
setShouldOptimizeResultSetAccess
public void setShouldOptimizeResultSetAccess(boolean shouldOptimizeResultSetAccess) ADVANCED: Set to indicate whether ObjectLevelReadQuery should by default use ResultSet Access optimization. If not set then parent's flag is used, is none set then ObjectLevelReadQuery.isResultSetAccessOptimizedQueryDefault is used. If the optimization specified by the session is ignored if incompatible with other query settings. -
shouldOptimizeResultSetAccess
public boolean shouldOptimizeResultSetAccess()ADVANCED: Indicates whether ObjectLevelReadQuery should by default use ResultSet Access optimization. Optimization specified by the session is ignored if incompatible with other query settings. -
setTolerateInvalidJPQL
public void setTolerateInvalidJPQL(boolean b) ADVANCED: Indicates whether an invalid NamedQuery will be tolerated at init time. Default is false. -
shouldTolerateInvalidJPQL
public boolean shouldTolerateInvalidJPQL()ADVANCED: Indicates whether an invalid NamedQuery will be tolerated at init time. Default is false.
-