|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate3.support.HibernateDaoSupport
org.alfresco.repo.domain.hibernate.SessionSizeResourceManager
public class SessionSizeResourceManager
A Hibernate-specific resource manager that ensures that the current Session's
entity count doesn't exceed a given threshold.
Session-linked
objects up the stack from where this instance resides. Failure to observe this will
most likely result in data loss of a sporadic nature.
org.alfresco.repo.domain.hibernate.HibernateNodeTest#testPostCommitClearIssue()| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.alfresco.util.resource.MethodResourceManager |
|---|
MethodResourceManager.MethodStatistics |
| Field Summary | |
|---|---|
static java.lang.String |
KEY_COMMIT_STARTED
|
| Constructor Summary | |
|---|---|
SessionSizeResourceManager()
Default public constructor required for bean instantiation. |
|
| Method Summary | |
|---|---|
static void |
clear(org.hibernate.Session session)
Clear the session now. |
static boolean |
isDisableInTransaction()
|
void |
manageResources(java.util.Map methodStatsByMethod,
long transactionElapsedTimeNs,
java.lang.reflect.Method currentMethod)
Check and free any required resources for an imminent. |
static void |
setCommitStarted()
|
static void |
setDisableInTransaction()
Disable resource management for the duration of the current transaction. |
static void |
setEnableInTransaction()
Enable resource management for the duration of the current transaction. |
void |
setReadThreshold(int threshold)
Set the Session.clear() threshold for read-only transactions. |
void |
setRetentionFactor(int retentionFactor)
Set the number of entities retained in the session for each one flushed; default 3. |
void |
setWriteThreshold(int threshold)
Set the Session.clear() threshold for read-write transactions. |
| Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport |
|---|
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory |
| Methods inherited from class org.springframework.dao.support.DaoSupport |
|---|
afterPropertiesSet, initDao |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String KEY_COMMIT_STARTED
| Constructor Detail |
|---|
public SessionSizeResourceManager()
| Method Detail |
|---|
public static void setDisableInTransaction()
public static void setEnableInTransaction()
public static boolean isDisableInTransaction()
false, the global setting will take effect.SessionSizeResourceManager.setDisableInTransaction()public void setRetentionFactor(int retentionFactor)
retentionFactor - the number of entities to keep for each entity removedpublic void setReadThreshold(int threshold)
Session.clear() threshold for read-only transactions.
If the number of entities and collections in the current session exceeds this number,
then the session will be cleared.
Have you read the disclaimer?
threshold - the maximum number of entities and associations to keep in memory during read-only operationsSessionSizeResourceManager.writeThresholdpublic void setWriteThreshold(int threshold)
Session.clear() threshold for read-write transactions.
If the number of entities and collections in the current session exceeds this number,
then the session will be cleared.
Have you read the disclaimer?
threshold - the maximum number of entities and associations to keep in memory during write operationsSessionSizeResourceManager.writeThresholdpublic static void setCommitStarted()
public void manageResources(java.util.Map methodStatsByMethod,
long transactionElapsedTimeNs,
java.lang.reflect.Method currentMethod)
MethodResourceManager
manageResources in interface MethodResourceManagermethodStatsByMethod - all known methods and their basic call statstransactionElapsedTimeNs - the elapsed time in the current transactioncurrentMethod - the method about to be calledpublic static void clear(org.hibernate.Session session)
session -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||