mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fixed unreported error: New transactions started in the post-commit phase *might* see stale cache data
- Transactional caches were flushing last in the post-commit phase - New transactions in the post-commit phase would see cache data out of synch with the DB-committed data - Affects DOD5015 post-commit audit actions, which were not generating full datasets for the first-pass data import git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16627 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -778,6 +778,26 @@ public abstract class AlfrescoTransactionSupport
|
||||
logger.debug("After completion (" + statusStr + "): " + this);
|
||||
}
|
||||
|
||||
// Clean up the transactional caches
|
||||
for (TransactionalCache<Serializable, Object> cache : transactionalCaches)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (status == TransactionSynchronization.STATUS_COMMITTED)
|
||||
{
|
||||
cache.afterCommit();
|
||||
}
|
||||
else
|
||||
{
|
||||
cache.afterRollback();
|
||||
}
|
||||
}
|
||||
catch (RuntimeException e)
|
||||
{
|
||||
logger.error("After completion (" + statusStr + ") TransactionalCache exception", e);
|
||||
}
|
||||
}
|
||||
|
||||
List<TransactionListener> iterableListeners = getListenersIterable();
|
||||
// notify listeners
|
||||
if (status == TransactionSynchronization.STATUS_COMMITTED)
|
||||
@@ -833,26 +853,6 @@ public abstract class AlfrescoTransactionSupport
|
||||
}
|
||||
}
|
||||
|
||||
// Clean up the transactional caches
|
||||
for (TransactionalCache<Serializable, Object> cache : transactionalCaches)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (status == TransactionSynchronization.STATUS_COMMITTED)
|
||||
{
|
||||
cache.afterCommit();
|
||||
}
|
||||
else
|
||||
{
|
||||
cache.afterRollback();
|
||||
}
|
||||
}
|
||||
catch (RuntimeException e)
|
||||
{
|
||||
logger.error("After completion (" + statusStr + ") TransactionalCache exception", e);
|
||||
}
|
||||
}
|
||||
|
||||
// clear the thread's registrations and synchronizations
|
||||
AlfrescoTransactionSupport.clearSynchronization();
|
||||
}
|
||||
|
Reference in New Issue
Block a user