Class StatelessSessionImpl
- All Implemented Interfaces:
Serializable
,AutoCloseable
,LobCreationContext
,SharedSessionContractImplementor
,QueryProducer
,QueryProducerImplementor
,JdbcSessionOwner
,TransactionCoordinatorBuilder.Options
,SharedSessionContract
,StatelessSession
,JavaType.CoercionContext
,WrapperOptions
StatelessSession
API.
Exposes two interfaces:
StatelessSession
to the application, andSharedSessionContractImplementor
(an SPI interface) to other subsystems.
This class is not thread-safe.
- See Also:
- Implementation Note:
- The
StatelessSessionImpl
is not anEventSource
and does not make use of the usual eventing infrastructure to implement persistence operations. It does raise pre- and post- events for the benefit of integration, however. Since it performs all operations synchronously, it does not maintain anActionQueue
. Therefore, it cannot, unfortunately, reuse the variousEntityAction
subtypes. This is a pity, since it results in some code duplication. On the other hand, aStatelessSession
is easier to debug and understand. AStatelessSession
does hold state in a long-livedPersistenceContext
, but it does temporarily keep state within an instance ofStatefulPersistenceContext
while processing the results of a given query.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hibernate.engine.jdbc.LobCreationContext
LobCreationContext.Callback<T>
-
Field Summary
Fields inherited from class org.hibernate.internal.AbstractSharedSessionContract
closed, waitingForAutoClose
-
Constructor Summary
ConstructorsConstructorDescriptionStatelessSessionImpl
(SessionFactoryImpl factory, SessionCreationOptions options) -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterOperation
(boolean success) Check if there is a Hibernate or JTA transaction in progress and, if there is not, flush if necessary, making sure that the connection has been committed (if it is not in autocommit mode), and finally run the after completion processing.void
Called after each operation on aScrollableResults
, providing an opportunity for a stateless session to clear its temporary persistence context.void
An after-begin callback from the coordinator to its owner.void
afterTransactionCompletion
(boolean successful, boolean delayed) An after-completion callback to the owner.Cast this object toStatelessSession
, if possible.boolean
autoFlushIfRequired
(Set<String> querySpaces) detect in-memory changes, determine if the changes are to tables named in the query and, if so, complete execution the flushvoid
A before-completion callback to the owner.bestGuessEntityName
(Object object) Obtain the best estimate of the entity name of the given entity instance, which is not involved in an association, by also considering information held in the proxy, and whether the object is already associated with this session.void
Delete a record.void
Delete a record.void
deleteMultiple
(List<?> entities) Delete multiple records.void
Fetch an association or collection that's configured for lazy loading.void
flush()
Flush this session.void
<T> T
get
(EntityGraph<T> graph, GraphSemantic graphSemantic, Object id) Retrieve a record, fetching associations specified by the givenEntityGraph
.<T> T
get
(EntityGraph<T> graph, GraphSemantic graphSemantic, Object id, LockMode lockMode) Retrieve a record, fetching associations specified by the givenEntityGraph
, and obtaining the specified lock mode.<T> T
Retrieve a record.<T> T
Retrieve a record, obtaining the specified lock mode.Retrieve a record.Retrieve a record, obtaining the specified lock mode.getContextEntityIdentifier
(Object object) Return the identifier of the persistent object, or null if it is not associated with this session.getEntityPersister
(String entityName, Object object) Get theEntityPersister
for the given entity instance.Get the entity instance associated with the givenEntityKey
, calling theInterceptor
if necessary.getIdentifier
(Object entity) Return the identifier value of the given entity, which may be detached.Get theLoadQueryInfluencers
associated with this session.<T> List<T>
getMultiple
(Class<T> entityClass, List<Object> ids) Retrieve multiple rows, returning entity instances in a list where the position of an instance in the list matches the position of its identifier in the given array, and the list contains a null value if there is no persistent instance matching a given identifier.Get the persistence context for this session.Similar toSharedSessionContractImplementor.getPersistenceContext()
, with two differences: this version performs better as it allows for inlining and probably better prediction, and it skips some checks of the current state of the session.guessEntityName
(Object entity) Obtain an estimate of the entity name of the given entity instance, which is not involved in an association, using only theEntityNameResolver
.immediateLoad
(String entityName, Object id) Load an instance immediately.void
initializeCollection
(PersistentCollection<?> collection, boolean writing) Initialize the given collection (if not already initialized).Insert a record.Insert a record.void
insertMultiple
(List<?> entities) Insert multiple records.instantiate
(String entityName, Object id) Instantiate the entity class, initializing with the given identifier.instantiate
(EntityPersister persister, Object id) Instantiate the entity class of the givenEntityPersister
, initializing the new instance with the given identifier.internalLoad
(String entityName, Object id, boolean eager, boolean nullable) Obtain an entity instance with the given id, without checking if it was deleted or scheduled for deletion.boolean
Is auto-close at transaction completion enabled?boolean
Are entities and proxies loaded by this session read-only by default?boolean
Does this object implementStatelessSession
?boolean
Does this session have an active Hibernate transaction, or is it associated with a JTA transaction currently in progress?protected Object
lockCacheItem
(Object id, Object previousVersion, EntityPersister persister) protected Object
lockCacheItem
(Object key, CollectionPersister persister) void
Refresh the entity instance state from the database.void
Refresh the entity instance state from the database.void
Refresh the entity instance state from the database.void
Refresh the entity instance state from the database.protected void
removeCacheItem
(Object ck, CollectionPersister persister) protected void
removeCacheItem
(Object ck, EntityPersister persister) void
setAutoClear
(boolean enabled) Enable or disable automatic cache clearing from after transaction completion.void
setDefaultReadOnly
(boolean readOnly) void
setHibernateFlushMode
(FlushMode flushMode) Set the currentFlushMode
for this session.boolean
Should this session be automatically closed after the current transaction completes?boolean
Indicates whether an active transaction should be automatically joined.void
Update a record.void
Update a record.void
updateMultiple
(List<?> entities) Update multiple records.void
Use a SQLmerge into
statement to perform an upsert, that is, to insert the record if it does not exist, or update it if it already exists.void
Use a SQLmerge into
statement to perform an upsert.void
upsertMultiple
(List<?> entities) Perform an upsert, that is, to insert the record if it does not exist, or update the record if it already exists, for each given record.Methods inherited from class org.hibernate.internal.AbstractSharedSessionContract
accessTransaction, addResultType, addSharedSessionTransactionObserver, applyQuerySettingsAndHints, applyQuerySettingsAndHints, beginTransaction, buildNamedQuery, buildNamedQuery, checkMutationQuery, checkOpen, checkResultType, checkSelectionQuery, checkTransactionNeededForUpdateOperation, checkTransactionSynchStatus, cleanupOnClose, close, createCriteriaQuery, createEntityGraph, createEntityGraph, createEntityGraph, createMutationQuery, createMutationQuery, createMutationQuery, createMutationQuery, createMutationQuery, createNamedMutationQuery, createNamedQuery, createNamedQuery, createNamedSelectionQuery, createNamedSelectionQuery, createNamedStoredProcedureQuery, createNativeMutationQuery, createNativeQuery, createNativeQuery, createNativeQuery, createNativeQuery, createNativeQuery, createNativeQueryImplementor, createNativeQueryImplementor, createQuery, createQuery, createQuery, createQuery, createQuery, createQuery, createSelectionQuery, createSelectionQuery, createSelectionQuery, createSqmQueryImplementor, createSqmQueryImplementor, createStoredProcedureCall, createStoredProcedureCall, createStoredProcedureCall, createStoredProcedureQuery, createStoredProcedureQuery, createStoredProcedureQuery, delayedAfterCompletion, disableFilter, doReturningWork, doWork, enableFilter, execute, generateEntityKey, getCacheMode, getCacheTransactionSynchronization, getConfiguredJdbcBatchSize, getCriteriaBuilder, getCurrentTransaction, getDialect, getEnabledFilter, getEntityGraph, getEntityGraphs, getEntityNameResolver, getEventListenerManager, getEventMonitor, getExceptionConverter, getFactory, getFlushMode, getHibernateFlushMode, getInterceptor, getJdbcBatchSize, getJdbcConnectionAccess, getJdbcCoordinator, getJdbcServices, getJdbcSessionContext, getJdbcTimeZone, getJsonFormatMapper, getLobCreator, getNamedNativeQuery, getNamedNativeQuery, getNamedProcedureCall, getNamedQuery, getNativeJdbcParametersIgnored, getPreferredSqlTypeCodeForBoolean, getResultSetMappingMemento, getSessionFactory, getSessionIdentifier, getSessionToken, getTenantIdentifier, getTenantIdentifierValue, getTransaction, getTransactionCoordinator, getTypeConfiguration, getXmlFormatMapper, interpretHql, isClosed, isConnected, isCriteriaCopyTreeEnabled, isJoinedToTransaction, isOpen, isOpenOrWaitingForAutoClose, joinTransaction, markForRollbackOnly, prepareForAutoClose, prepareForQueryExecution, pulseTransactionCoordinator, removeSharedSessionTransactionObserver, setCacheMode, setClosed, setCriteriaCopyTreeEnabled, setJdbcBatchSize, setNativeJdbcParametersIgnored, setUpMultitenancy, shouldCloseJdbcCoordinatorOnClose, startTransactionBoundary, useStreamForLobBinding
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.resource.jdbc.spi.JdbcSessionOwner
getEventManager, getSqlExceptionHelper
Methods inherited from interface org.hibernate.engine.jdbc.LobCreationContext
fromContext
Methods inherited from interface org.hibernate.query.QueryProducer
createMutationQuery, createMutationQuery, createNamedSelectionQuery, createNamedSelectionQuery, createSelectionQuery, createSelectionQuery, createSelectionQuery
Methods inherited from interface org.hibernate.SharedSessionContract
beginTransaction, createEntityGraph, createEntityGraph, createEntityGraph, createNamedStoredProcedureQuery, createStoredProcedureCall, createStoredProcedureCall, createStoredProcedureCall, createStoredProcedureQuery, createStoredProcedureQuery, createStoredProcedureQuery, disableFilter, doReturningWork, doWork, enableFilter, getCacheMode, getCriteriaBuilder, getEnabledFilter, getEntityGraph, getEntityGraphs, getJdbcBatchSize, getNamedProcedureCall, getTenantIdentifier, getTenantIdentifierValue, getTransaction, isConnected, isJoinedToTransaction, isOpen, joinTransaction, setCacheMode, setJdbcBatchSize
Methods inherited from interface org.hibernate.engine.spi.SharedSessionContractImplementor
asEventSource, asSessionImplementor, autoFlushIfRequired, autoPreFlush, bestGuessEntityName, checkOpen, getSession, isEventSource, isSessionImplementor
Methods inherited from interface org.hibernate.StatelessSession
close
-
Constructor Details
-
StatelessSessionImpl
-
-
Method Details
-
shouldAutoJoinTransaction
public boolean shouldAutoJoinTransaction()Description copied from interface:TransactionCoordinatorBuilder.Options
Indicates whether an active transaction should be automatically joined. Only relevant for JTA-based TransactionCoordinator instances.- Specified by:
shouldAutoJoinTransaction
in interfaceTransactionCoordinatorBuilder.Options
- Overrides:
shouldAutoJoinTransaction
in classAbstractSharedSessionContract
- Returns:
true
indicates the active transaction should be auto joined;false
indicates it should not (untilTransactionCoordinator.explicitJoin()
is called).
-
insert
Description copied from interface:StatelessSession
Insert a record.If the entity
@Id
field is declared to be generated, for example, if it is annotated@GeneratedValue
, the id is generated and assigned to the given instance.The
PostPersist
callback will be triggered if the operation is successful.- Specified by:
insert
in interfaceStatelessSession
- Parameters:
entity
- a new transient instance- Returns:
- The identifier of the inserted entity
-
insertMultiple
Description copied from interface:StatelessSession
Insert multiple records.- Specified by:
insertMultiple
in interfaceStatelessSession
- Parameters:
entities
- a list of transient instances to be inserted
-
insert
Description copied from interface:StatelessSession
Insert a record.The
PostPersist
callback will be triggered if the operation is successful.- Specified by:
insert
in interfaceStatelessSession
- Parameters:
entityName
- The entityName for the entity to be insertedentity
- a new transient instance- Returns:
- the identifier of the instance
-
delete
Description copied from interface:StatelessSession
Delete a record.The
PostRemove
callback will be triggered if the operation is successful.- Specified by:
delete
in interfaceStatelessSession
- Parameters:
entity
- a detached entity instance
-
deleteMultiple
Description copied from interface:StatelessSession
Delete multiple records.- Specified by:
deleteMultiple
in interfaceStatelessSession
- Parameters:
entities
- a list of detached instances to be deleted
-
delete
Description copied from interface:StatelessSession
Delete a record.The
PostRemove
callback will be triggered if the operation is successful.- Specified by:
delete
in interfaceStatelessSession
- Parameters:
entityName
- The entityName for the entity to be deletedentity
- a detached entity instance
-
update
Description copied from interface:StatelessSession
Update a record.The
PostUpdate
callback will be triggered if the operation is successful.- Specified by:
update
in interfaceStatelessSession
- Parameters:
entity
- a detached entity instance
-
updateMultiple
Description copied from interface:StatelessSession
Update multiple records.- Specified by:
updateMultiple
in interfaceStatelessSession
- Parameters:
entities
- a list of detached instances to be updated
-
update
Description copied from interface:StatelessSession
Update a record.The
PostUpdate
callback will be triggered if the operation is successful.- Specified by:
update
in interfaceStatelessSession
- Parameters:
entityName
- The entityName for the entity to be updatedentity
- a detached entity instance
-
upsert
Description copied from interface:StatelessSession
Use a SQLmerge into
statement to perform an upsert, that is, to insert the record if it does not exist, or update it if it already exists.This method never performs id generation, and does not accept an entity instance with a null identifier. When id generation is required, use
StatelessSession.insert(Object)
.On the other hand,
upsert()
does accept an entity instance with an assigned identifier value, even if the entity@Id
field is declared to be generated, for example, if it is annotated@GeneratedValue
. Thus, this method may be used to import data from an external source.- Specified by:
upsert
in interfaceStatelessSession
- Parameters:
entity
- a detached entity instance, or a new instance with an assigned identifier
-
upsertMultiple
Description copied from interface:StatelessSession
Perform an upsert, that is, to insert the record if it does not exist, or update the record if it already exists, for each given record.- Specified by:
upsertMultiple
in interfaceStatelessSession
- Parameters:
entities
- a list of detached instances and new instances with assigned identifiers
-
upsert
Description copied from interface:StatelessSession
Use a SQLmerge into
statement to perform an upsert.- Specified by:
upsert
in interfaceStatelessSession
- Parameters:
entityName
- The entityName for the entity to be mergedentity
- a detached entity instance
-
get
Description copied from interface:StatelessSession
Retrieve a record.- Specified by:
get
in interfaceStatelessSession
- Parameters:
entityClass
- The class of the entity to retrieveid
- The id of the entity to retrieve- Returns:
- a detached entity instance
-
get
Description copied from interface:StatelessSession
Retrieve a record, obtaining the specified lock mode.- Specified by:
get
in interfaceStatelessSession
- Parameters:
entityClass
- The class of the entity to retrieveid
- The id of the entity to retrievelockMode
- The lock mode to apply to the entity- Returns:
- a detached entity instance
-
get
Description copied from interface:StatelessSession
Retrieve a record.- Specified by:
get
in interfaceStatelessSession
- Parameters:
entityName
- The name of the entity to retrieveid
- The id of the entity to retrieve- Returns:
- a detached entity instance
-
get
Description copied from interface:StatelessSession
Retrieve a record, obtaining the specified lock mode.- Specified by:
get
in interfaceStatelessSession
- Parameters:
entityName
- The name of the entity to retrieveid
- The id of the entity to retrievelockMode
- The lock mode to apply to the entity- Returns:
- a detached entity instance
-
get
Description copied from interface:StatelessSession
Retrieve a record, fetching associations specified by the givenEntityGraph
.- Specified by:
get
in interfaceStatelessSession
- Parameters:
graph
- TheEntityGraph
graphSemantic
- aGraphSemantic
specifying how the graph should be interpretedid
- The id of the entity to retrieve- Returns:
- a detached entity instance
-
get
Description copied from interface:StatelessSession
Retrieve a record, fetching associations specified by the givenEntityGraph
, and obtaining the specified lock mode.- Specified by:
get
in interfaceStatelessSession
- Parameters:
graph
- TheEntityGraph
graphSemantic
- aGraphSemantic
specifying how the graph should be interpretedid
- The id of the entity to retrievelockMode
- The lock mode to apply to the entity- Returns:
- a detached entity instance
-
getMultiple
Description copied from interface:StatelessSession
Retrieve multiple rows, returning entity instances in a list where the position of an instance in the list matches the position of its identifier in the given array, and the list contains a null value if there is no persistent instance matching a given identifier.- Specified by:
getMultiple
in interfaceStatelessSession
- Parameters:
entityClass
- The class of the entity to retrieveids
- The ids of the entities to retrieve- Returns:
- an ordered list of detached entity instances, with null elements representing missing entities
-
refresh
Description copied from interface:StatelessSession
Refresh the entity instance state from the database.- Specified by:
refresh
in interfaceStatelessSession
- Parameters:
entity
- The entity to be refreshed.
-
refresh
Description copied from interface:StatelessSession
Refresh the entity instance state from the database.- Specified by:
refresh
in interfaceStatelessSession
- Parameters:
entityName
- The entityName for the entity to be refreshed.entity
- The entity to be refreshed.
-
refresh
Description copied from interface:StatelessSession
Refresh the entity instance state from the database.- Specified by:
refresh
in interfaceStatelessSession
- Parameters:
entity
- The entity to be refreshed.lockMode
- The LockMode to be applied.
-
refresh
Description copied from interface:StatelessSession
Refresh the entity instance state from the database.- Specified by:
refresh
in interfaceStatelessSession
- Parameters:
entityName
- The entityName for the entity to be refreshed.entity
- The entity to be refreshed.lockMode
- The LockMode to be applied.
-
immediateLoad
Description copied from interface:SharedSessionContractImplementor
Load an instance immediately. This method is only called when lazily initializing a proxy. Do not return the proxy.- Specified by:
immediateLoad
in interfaceSharedSessionContractImplementor
-
initializeCollection
Description copied from interface:SharedSessionContractImplementor
Initialize the given collection (if not already initialized).- Specified by:
initializeCollection
in interfaceSharedSessionContractImplementor
-
instantiate
Description copied from interface:SharedSessionContractImplementor
Instantiate the entity class, initializing with the given identifier.- Specified by:
instantiate
in interfaceSharedSessionContractImplementor
-
instantiate
Description copied from interface:SharedSessionContractImplementor
Instantiate the entity class of the givenEntityPersister
, initializing the new instance with the given identifier.This is more efficient than
SharedSessionContractImplementor.instantiate(String, Object)
, but not always interchangeable, since a single persister might be responsible for multiple types.- Specified by:
instantiate
in interfaceSharedSessionContractImplementor
-
internalLoad
Description copied from interface:SharedSessionContractImplementor
Obtain an entity instance with the given id, without checking if it was deleted or scheduled for deletion.- When
nullable = false
, this method may create a new proxy or return an existing proxy; if it does not exist, an exception is thrown. - When
nullable = true
, the method does not create new proxies, though it might return an existing proxy; if it does not exist, anull
value is returned.
When
eager = true
, the object is eagerly fetched from the database.- Specified by:
internalLoad
in interfaceSharedSessionContractImplementor
- When
-
fetch
Description copied from interface:StatelessSession
Fetch an association or collection that's configured for lazy loading.Book book = session.get(Book.class, isbn); // book is immediately detached session.fetch(book.getAuthors()); // fetch the associated authors book.getAuthors().forEach(author -> ... ); // iterate the collection
Warning: this operation in a stateless session is quite sensitive to data aliasing effects and should be used with great care. It's usually better to fetch associations using eager join fetching.
- Specified by:
fetch
in interfaceStatelessSession
- Parameters:
association
- a lazy-loaded association- See Also:
-
getIdentifier
Description copied from interface:StatelessSession
Return the identifier value of the given entity, which may be detached.- Specified by:
getIdentifier
in interfaceStatelessSession
- Parameters:
entity
- a persistent instance associated with this session- Returns:
- the identifier
-
isAutoCloseSessionEnabled
public boolean isAutoCloseSessionEnabled()Description copied from interface:SharedSessionContractImplementor
Is auto-close at transaction completion enabled?- Specified by:
isAutoCloseSessionEnabled
in interfaceSharedSessionContractImplementor
- See Also:
-
shouldAutoClose
public boolean shouldAutoClose()Description copied from interface:SharedSessionContractImplementor
Should this session be automatically closed after the current transaction completes?- Specified by:
shouldAutoClose
in interfaceSharedSessionContractImplementor
-
bestGuessEntityName
Description copied from interface:SharedSessionContractImplementor
Obtain the best estimate of the entity name of the given entity instance, which is not involved in an association, by also considering information held in the proxy, and whether the object is already associated with this session.- Specified by:
bestGuessEntityName
in interfaceSharedSessionContractImplementor
-
setHibernateFlushMode
Description copied from interface:SharedSessionContractImplementor
Set the currentFlushMode
for this session.The flush mode determines the points at which the session is flushed. Flushing is the process of synchronizing the underlying persistent store with persistable state held in memory.
For a logically "read-only" session, it's reasonable to set the session flush mode to
FlushMode.MANUAL
at the start of the session (in order skip some work and gain some extra performance).- Specified by:
setHibernateFlushMode
in interfaceSharedSessionContractImplementor
- Overrides:
setHibernateFlushMode
in classAbstractSharedSessionContract
- Parameters:
flushMode
- the new flush mode
-
getContextEntityIdentifier
Description copied from interface:SharedSessionContractImplementor
Return the identifier of the persistent object, or null if it is not associated with this session.- Specified by:
getContextEntityIdentifier
in interfaceSharedSessionContractImplementor
-
guessEntityName
Description copied from interface:SharedSessionContractImplementor
Obtain an estimate of the entity name of the given entity instance, which is not involved in an association, using only theEntityNameResolver
.- Specified by:
guessEntityName
in interfaceSharedSessionContractImplementor
-
getEntityPersister
Description copied from interface:SharedSessionContractImplementor
Get theEntityPersister
for the given entity instance.- Specified by:
getEntityPersister
in interfaceSharedSessionContractImplementor
- Parameters:
entityName
- optional entity nameobject
- the entity instance
-
getEntityUsingInterceptor
Description copied from interface:SharedSessionContractImplementor
Get the entity instance associated with the givenEntityKey
, calling theInterceptor
if necessary.- Specified by:
getEntityUsingInterceptor
in interfaceSharedSessionContractImplementor
-
getPersistenceContext
Description copied from interface:SharedSessionContractImplementor
Get the persistence context for this session.See
SharedSessionContractImplementor.getPersistenceContextInternal()
for a faster alternative.- Specified by:
getPersistenceContext
in interfaceSharedSessionContractImplementor
-
setAutoClear
public void setAutoClear(boolean enabled) Description copied from interface:SharedSessionContractImplementor
Enable or disable automatic cache clearing from after transaction completion.- Specified by:
setAutoClear
in interfaceSharedSessionContractImplementor
-
isDefaultReadOnly
public boolean isDefaultReadOnly()Description copied from interface:SharedSessionContractImplementor
Are entities and proxies loaded by this session read-only by default?- Specified by:
isDefaultReadOnly
in interfaceSharedSessionContractImplementor
-
setDefaultReadOnly
public void setDefaultReadOnly(boolean readOnly) -
afterOperation
public void afterOperation(boolean success) Description copied from interface:SharedSessionContractImplementor
Check if there is a Hibernate or JTA transaction in progress and, if there is not, flush if necessary, making sure that the connection has been committed (if it is not in autocommit mode), and finally run the after completion processing.- Specified by:
afterOperation
in interfaceSharedSessionContractImplementor
- Parameters:
success
-true
if the operation a success
-
afterScrollOperation
public void afterScrollOperation()Description copied from interface:SharedSessionContractImplementor
Called after each operation on aScrollableResults
, providing an opportunity for a stateless session to clear its temporary persistence context. For a stateful session, this method does nothing.- Specified by:
afterScrollOperation
in interfaceSharedSessionContractImplementor
-
flush
public void flush()Description copied from interface:SharedSessionContractImplementor
Flush this session.- Specified by:
flush
in interfaceSharedSessionContractImplementor
-
getLoadQueryInfluencers
Description copied from interface:SharedSessionContractImplementor
Get theLoadQueryInfluencers
associated with this session.- Specified by:
getLoadQueryInfluencers
in interfaceSharedSessionContractImplementor
- Returns:
- the
LoadQueryInfluencers
associated with this session; should never be null.
-
getPersistenceContextInternal
Description copied from interface:SharedSessionContractImplementor
Similar toSharedSessionContractImplementor.getPersistenceContext()
, with two differences:- this version performs better as it allows for inlining and probably better prediction, and
- it skips some checks of the current state of the session.
- Specified by:
getPersistenceContextInternal
in interfaceSharedSessionContractImplementor
- Returns:
- the
PersistenceContext
associated to this session.
-
autoFlushIfRequired
Description copied from interface:SharedSessionContractImplementor
detect in-memory changes, determine if the changes are to tables named in the query and, if so, complete execution the flush- Specified by:
autoFlushIfRequired
in interfaceSharedSessionContractImplementor
- Parameters:
querySpaces
- the tables named in the query.- Returns:
- true if flush is required, false otherwise.
-
afterTransactionBegin
public void afterTransactionBegin()Description copied from interface:JdbcSessionOwner
An after-begin callback from the coordinator to its owner.- Specified by:
afterTransactionBegin
in interfaceJdbcSessionOwner
-
beforeTransactionCompletion
public void beforeTransactionCompletion()Description copied from interface:JdbcSessionOwner
A before-completion callback to the owner.- Specified by:
beforeTransactionCompletion
in interfaceJdbcSessionOwner
- Overrides:
beforeTransactionCompletion
in classAbstractSharedSessionContract
-
afterTransactionCompletion
public void afterTransactionCompletion(boolean successful, boolean delayed) Description copied from interface:JdbcSessionOwner
An after-completion callback to the owner.- Specified by:
afterTransactionCompletion
in interfaceJdbcSessionOwner
- Overrides:
afterTransactionCompletion
in classAbstractSharedSessionContract
- Parameters:
successful
- Was the transaction successful?delayed
- Is this a delayed after transaction completion call (aka after a timeout)?
-
isTransactionInProgress
public boolean isTransactionInProgress()Description copied from interface:SharedSessionContractImplementor
Does this session have an active Hibernate transaction, or is it associated with a JTA transaction currently in progress?- Specified by:
isTransactionInProgress
in interfaceSharedSessionContractImplementor
- Overrides:
isTransactionInProgress
in classAbstractSharedSessionContract
-
flushBeforeTransactionCompletion
public void flushBeforeTransactionCompletion()- Specified by:
flushBeforeTransactionCompletion
in interfaceJdbcSessionOwner
-
asStatelessSession
Description copied from interface:SharedSessionContractImplementor
Cast this object toStatelessSession
, if possible.- Specified by:
asStatelessSession
in interfaceSharedSessionContractImplementor
-
isStatelessSession
public boolean isStatelessSession()Description copied from interface:SharedSessionContractImplementor
Does this object implementStatelessSession
?- Specified by:
isStatelessSession
in interfaceSharedSessionContractImplementor
-
lockCacheItem
-
removeCacheItem
-
lockCacheItem
-
removeCacheItem
-