Merged V3.4-BUG-FIX

30520: Revisited timestamp propagation (cm:modified) now that the system does this by default
          - Original low-level code (Hibernate optimizations) pulled back into NodeService implementation
          - Use case driven prompting to touch the parent node
          - Full indexing and policy callbacks against parent (was missing completely)
          - Optimizations to ensure parent node modifications are only done where required and
            the same transaction is used where possible
          - 1s accuracy limit is maintained to prevent unnecessary modifications
          - Enhanced tests to cover use cases where propagation is expected
            - ALF-10262: Timestamp propagation is enabled by default
          - Fixes or will fix:
            - ALF-10291: Test disabled: SOLRTrackingComponentTest (various)
            - ALF-7433: A file deleted using the web UI still appears in a NFS mount but with NULL stats
            - ALF-10271: Test disabled: ArchiveAndRestoreTest.testAR7889ArchiveAndRestoreMustNotModifyAuditable
            - ALF-10267: Test disabled: NodeServiceTest.testArchiveAndRestore
         Also
          - Found problem where cm:auditable properties could be modified directly against the cached values
          - Extended locking of cached entities to the AuditablePropertiesEntity


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30598 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2011-09-19 11:30:56 +00:00
parent 5e3cb4cb96
commit fb406b769b
14 changed files with 606 additions and 683 deletions

View File

@@ -29,10 +29,8 @@ import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.ApplicationContextHelper;
import org.alfresco.util.GUID;
import org.alfresco.util.Pair;
import org.springframework.context.ApplicationContext;
@@ -85,49 +83,10 @@ public class NodeDAOTest extends TestCase
// Expected
}
// Read-only
try
{
txnHelper.doInTransaction(getTxnIdCallback, true);
fail("Should have failed when running in read-only transaction");
}
catch (Throwable e)
{
// Expected
}
assertNull("No Txn ID should be present in read-only txn", txnHelper.doInTransaction(getTxnIdCallback, true));
// First success
Long txnId1 = txnHelper.doInTransaction(getTxnIdCallback);
assertNotNull("No txn ID 1", txnId1);
Long txnId2 = txnHelper.doInTransaction(getTxnIdCallback);
assertNotNull("No txn ID 2", txnId2);
assertTrue("2nd ID should be larger than first", txnId2.compareTo(txnId1) > 0);
}
/**
* TODO: Clean up after test or force indexing on the stores
*/
public void xtestNewStore() throws Exception
{
final StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_TEST, getName() + "-" + GUID.generate());
RetryingTransactionCallback<Pair<Long, NodeRef>> callback = new RetryingTransactionCallback<Pair<Long, NodeRef>>()
{
public Pair<Long, NodeRef> execute() throws Throwable
{
return nodeDAO.newStore(storeRef);
}
};
Pair<Long, NodeRef> rootNodePair = txnHelper.doInTransaction(callback);
assertNotNull(rootNodePair);
assertEquals("Root node has incorrect store", storeRef, rootNodePair.getSecond().getStoreRef());
// Should fail second time
try
{
txnHelper.doInTransaction(callback);
fail("Should not be able to create same store.");
}
catch (Throwable e)
{
// Expected
}
assertNull("No Txn ID should be present in untouched txn", txnId1);
}
public void testGetNodesWithAspects() throws Throwable