Package org.alfresco.repo.transaction
Class AlfrescoTransactionSupport
- java.lang.Object
-
- org.alfresco.util.transaction.TransactionSupportUtil
-
- org.alfresco.repo.transaction.AlfrescoTransactionSupport
-
public abstract class AlfrescoTransactionSupport extends org.alfresco.util.transaction.TransactionSupportUtilRepo Specific Helper class to manage transaction synchronization. This provides helpers to ensure that the necessaryTransactionSynchronizationinstances are registered on behalf of the application code.This class remains for backward API compatibility, the majority of transaction support has been moved to TransactionSupportUtil in the Core project.
- Author:
- Derek Hulley, mrogers
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAlfrescoTransactionSupport.TxnReadState
-
Field Summary
Fields Modifier and Type Field Description static intSESSION_SYNCHRONIZATION_ORDERThe order of synchronization set to be 100 less than the Hibernate synchronization order
-
Constructor Summary
Constructors Constructor Description AlfrescoTransactionSupport()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidbindDaoService(TransactionalDao daoService)Method that registers a NodeDaoService against the transaction.static voidbindIntegrityChecker(IntegrityChecker integrityChecker)Method that registers an IntegrityChecker against the transaction.static voidbindListener(TransactionListener listener)Method maintained for backward compatibility: ACE-2801: Package change for TransactionListener.static voidbindListener(org.alfresco.util.transaction.TransactionListener listener)Method that registers a Listener against the transaction.static voidbindLucene(LuceneIndexerAndSearcher indexerAndSearcher)Method that registers a LuceneIndexerAndSearcherFactory against the transaction.static voidcheckTransactionReadState(boolean requireReadWrite)Checks the state of the current transaction and throws an exception if a transaction is not present or if the transaction is not read-write, if required.static voidflush()Deprecated.No longer does anythingstatic AlfrescoTransactionSupport.TxnReadStategetTransactionReadState()static booleanisDirty()Deprecated.To be replaced byDirtySessionMethodInterceptor
-
-
-
Field Detail
-
SESSION_SYNCHRONIZATION_ORDER
public static final int SESSION_SYNCHRONIZATION_ORDER
The order of synchronization set to be 100 less than the Hibernate synchronization order- See Also:
- Constant Field Values
-
-
Method Detail
-
getTransactionReadState
public static AlfrescoTransactionSupport.TxnReadState getTransactionReadState()
- Returns:
- Returns the read-write state of the current transaction
- Since:
- 2.1.4
-
checkTransactionReadState
public static void checkTransactionReadState(boolean requireReadWrite)
Checks the state of the current transaction and throws an exception if a transaction is not present or if the transaction is not read-write, if required.- Parameters:
requireReadWrite- true if the transaction must be read-write- Since:
- 3.2
-
isDirty
public static boolean isDirty()
Deprecated.To be replaced byDirtySessionMethodInterceptorAre there any pending changes which must be synchronized with the store?- Returns:
- true => changes are pending
-
bindDaoService
public static void bindDaoService(TransactionalDao daoService)
Method that registers a NodeDaoService against the transaction. Setting this will ensure that the pre- and post-commit operations perform the necessary cleanups against the NodeDaoService.This method can be called repeatedly as long as the service being bound implements equals and hashCode.
- Parameters:
daoService- TransactionalDao
-
bindIntegrityChecker
public static void bindIntegrityChecker(IntegrityChecker integrityChecker)
Method that registers an IntegrityChecker against the transaction. Setting this will ensure that the pre- and post-commit operations perform the necessary cleanups against the IntegrityChecker.This method can be called repeatedly as long as the service being bound implements equals and hashCode.
- Parameters:
integrityChecker- IntegrityChecker
-
bindLucene
public static void bindLucene(LuceneIndexerAndSearcher indexerAndSearcher)
Method that registers a LuceneIndexerAndSearcherFactory against the transaction.Setting this will ensure that the pre- and post-commit operations perform the necessary cleanups against the LuceneIndexerAndSearcherFactory.
Although bound within a Set, it would still be better for the caller to only bind once per transaction, if possible.
- Parameters:
indexerAndSearcher- the Lucene indexer to perform transaction completion tasks on
-
bindListener
public static void bindListener(TransactionListener listener)
Method maintained for backward compatibility: ACE-2801: Package change for TransactionListener.- See Also:
TransactionSupportUtil,bindListener(org.alfresco.util.transaction.TransactionListener)
-
bindListener
public static void bindListener(org.alfresco.util.transaction.TransactionListener listener)
Method that registers a Listener against the transaction.will be better for the caller to only bind once per transaction, if possible.
- Parameters:
listener- the transaction listener tasks on- Since:
- 5.0
-
flush
public static void flush()
Deprecated.No longer does anythingNo-op
-
-