public class SessionHolder extends org.springframework.transaction.support.ResourceHolderSupport
Holds a reference to one or more sessions.
| Constructor and description |
|---|
SessionHolder(Session session) |
SessionHolder(Session session, java.lang.Object creator) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
addSession(Session session) |
|
public void |
clear() |
|
public boolean |
containsSession(Session session) |
|
public boolean |
doesNotHoldNonDefaultSession() |
|
public java.lang.Object |
getCreator() |
|
public Session |
getSession() |
|
public java.util.Collection<Session> |
getSessions()
|
|
public Transaction<?> |
getTransaction() |
|
public Session |
getValidatedSession() |
|
public boolean |
isEmpty() |
|
public boolean |
isRollbackOnly(Session session)
|
|
public boolean |
isTransactionActive()Whether a DatastoreTransactionManager transaction is in progress on the session this holder hands out (getSession(), the most recently bound): from when the manager begins one on it until that transaction commits or rolls back. |
|
public void |
removeSession(Session session) |
|
public void |
resetRollbackOnly(Session session)Clears the mark setRollbackOnly(Session) made, once the session's transaction has completed, so that the next transaction begun on the session does not inherit it. |
|
public void |
setRollbackOnly(Session session)Marks the transaction in progress on the given session rollback-only, as a transaction that joined it and failed does. |
|
public void |
setSynchronizedWithTransaction(boolean synchronizedWithTransaction) |
|
public void |
setTransaction(Transaction<?> transaction) |
|
public void |
setTransactionActive(Session session, boolean active)Records that a transaction is, or is no longer, in progress on the given session. |
|
public int |
size() |
| Methods inherited from class | Name |
|---|---|
class org.springframework.transaction.support.ResourceHolderSupport |
org.springframework.transaction.support.ResourceHolderSupport#clear(), org.springframework.transaction.support.ResourceHolderSupport#equals(java.lang.Object), org.springframework.transaction.support.ResourceHolderSupport#getClass(), org.springframework.transaction.support.ResourceHolderSupport#getDeadline(), org.springframework.transaction.support.ResourceHolderSupport#getTimeToLiveInMillis(), org.springframework.transaction.support.ResourceHolderSupport#getTimeToLiveInSeconds(), org.springframework.transaction.support.ResourceHolderSupport#hasTimeout(), org.springframework.transaction.support.ResourceHolderSupport#hashCode(), org.springframework.transaction.support.ResourceHolderSupport#isOpen(), org.springframework.transaction.support.ResourceHolderSupport#isRollbackOnly(), org.springframework.transaction.support.ResourceHolderSupport#isSynchronizedWithTransaction(), org.springframework.transaction.support.ResourceHolderSupport#isVoid(), org.springframework.transaction.support.ResourceHolderSupport#notify(), org.springframework.transaction.support.ResourceHolderSupport#notifyAll(), org.springframework.transaction.support.ResourceHolderSupport#released(), org.springframework.transaction.support.ResourceHolderSupport#requested(), org.springframework.transaction.support.ResourceHolderSupport#reset(), org.springframework.transaction.support.ResourceHolderSupport#resetRollbackOnly(), org.springframework.transaction.support.ResourceHolderSupport#setRollbackOnly(), org.springframework.transaction.support.ResourceHolderSupport#setSynchronizedWithTransaction(boolean), org.springframework.transaction.support.ResourceHolderSupport#setTimeoutInMillis(long), org.springframework.transaction.support.ResourceHolderSupport#setTimeoutInSeconds(int), org.springframework.transaction.support.ResourceHolderSupport#toString(), org.springframework.transaction.support.ResourceHolderSupport#unbound(), org.springframework.transaction.support.ResourceHolderSupport#wait(), org.springframework.transaction.support.ResourceHolderSupport#wait(long), org.springframework.transaction.support.ResourceHolderSupport#wait(long, int) |
session - the session the transaction was begun on Whether a DatastoreTransactionManager transaction is in progress on the session this
holder hands out (getSession(), the most recently bound): from when the manager begins
one on it until that transaction commits or rolls back. A transaction started meanwhile joins it
rather than beginning another on the same session. A session bound on top of it, as
withNewSession binds one, has no transaction in progress until one is begun on it.
Not getTransaction().isActive(): a session's transaction object can outlive its
transaction, and some report themselves active whether or not one is in progress.
true while a transaction is in progress on the session this holder hands outClears the mark setRollbackOnly(Session) made, once the session's transaction has completed, so that the next transaction begun on the session does not inherit it.
session - the session the transaction was begun on Marks the transaction in progress on the given session rollback-only, as a transaction that
joined it and failed does. The mark belongs to that session's transaction alone: a transaction
begun in a session bound on top of it, as withNewSession binds one, neither inherits it
nor clears it when it completes. setRollbackOnly() still marks the holder as a whole.
session - the session the transaction was begun onRecords that a transaction is, or is no longer, in progress on the given session.
session - the session the transaction was begun onactive - whether it is in progress