mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Fix for concurrency bug found last night, as best as I can tell so far.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4558 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -35,9 +35,9 @@ public class AVMCrawlTestP extends AVMServiceTestBase
|
||||
*/
|
||||
public void testCrawl()
|
||||
{
|
||||
int n = 2; // Number of Threads.
|
||||
int m = 4; // How many multiples of content to start with.
|
||||
long runTime = 600000; // 5 minutes
|
||||
int n = 8; // Number of Threads.
|
||||
int m = 32; // How many multiples of content to start with.
|
||||
long runTime = 21600000; // 6 hours.
|
||||
fService.purgeAVMStore("main");
|
||||
BulkLoader loader = new BulkLoader();
|
||||
loader.setAvmService(fService);
|
||||
|
@@ -284,15 +284,11 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
|
||||
ChildEntry existing = AVMDAOs.Instance().fChildEntryDAO.get(key);
|
||||
if (existing != null)
|
||||
{
|
||||
existing.setChild(node);
|
||||
AVMDAOs.Instance().fChildEntryDAO.update(existing);
|
||||
}
|
||||
else
|
||||
{
|
||||
ChildEntry entry = new ChildEntryImpl(key, node);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fChildEntryDAO.save(entry);
|
||||
AVMDAOs.Instance().fChildEntryDAO.delete(existing);
|
||||
}
|
||||
ChildEntry entry = new ChildEntryImpl(key, node);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fChildEntryDAO.save(entry);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -257,15 +257,11 @@ class PlainDirectoryNodeImpl extends DirectoryNodeImpl implements PlainDirectory
|
||||
ChildEntry existing = AVMDAOs.Instance().fChildEntryDAO.get(key);
|
||||
if (existing != null)
|
||||
{
|
||||
existing.setChild(node);
|
||||
AVMDAOs.Instance().fChildEntryDAO.update(existing);
|
||||
}
|
||||
else
|
||||
{
|
||||
ChildEntry entry = new ChildEntryImpl(key, node);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fChildEntryDAO.save(entry);
|
||||
AVMDAOs.Instance().fChildEntryDAO.delete(existing);
|
||||
}
|
||||
ChildEntry entry = new ChildEntryImpl(key, node);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fChildEntryDAO.save(entry);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -136,6 +136,7 @@ public class SimpleAVMSubmitAction extends ActionExecuterAbstractBase
|
||||
fAVMSyncService.update(diffs, fExcluder, false, false, true, true,
|
||||
"Submit of item: " + AVMNodeConverter.SplitBase(path)[1], null);
|
||||
// Cleanup by flattening the source relative to the destination.
|
||||
// This is an ugliness to prevent database write misorderings in flatten.
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
fAVMSyncService.flatten(storePath[0] + ":/appBase", websiteName + "-staging:/appBase");
|
||||
}
|
||||
|
Reference in New Issue
Block a user