mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
I think this fixes the race under load that I discovered. More testing is
needed. Once again this will require a new database as I've changed the AVM schema back. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4693 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -37,7 +37,7 @@ public class AVMCrawlTestP extends AVMServiceTestBase
|
||||
{
|
||||
int n = 4; // Number of Threads.
|
||||
int m = 12; // How many multiples of content to start with.
|
||||
long runTime = 28800000; // 6 hours.
|
||||
long runTime = 7200000; // 6 hours.
|
||||
fService.purgeStore("main");
|
||||
BulkLoader loader = new BulkLoader();
|
||||
loader.setAvmService(fService);
|
||||
|
@@ -248,8 +248,8 @@ class AVMCrawler implements Runnable
|
||||
private String randomName()
|
||||
{
|
||||
char [] chars = new char[2];
|
||||
chars[0] = (char)('a' + fRandom.nextInt(26));
|
||||
chars[1] = (char)('a' + fRandom.nextInt(26));
|
||||
chars[0] = (char)('a' + fRandom.nextInt(12));
|
||||
chars[1] = (char)('a' + fRandom.nextInt(12));
|
||||
return new String(chars);
|
||||
}
|
||||
|
||||
|
@@ -687,8 +687,8 @@ public class AVMRepository
|
||||
{
|
||||
dstNode.setAncestor(child);
|
||||
}
|
||||
dstDir.putChild(dstName, dstNode);
|
||||
dstDir.updateModTime();
|
||||
dstDir.putChild(dstName, dstNode);
|
||||
if (child == null)
|
||||
{
|
||||
dstNode.setAncestor(srcNode);
|
||||
|
@@ -237,8 +237,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
{
|
||||
newDir.setAncestor(child);
|
||||
}
|
||||
dir.putChild(name, newDir);
|
||||
dir.updateModTime();
|
||||
dir.putChild(name, newDir);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -280,8 +280,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
{
|
||||
newDir.setAncestor(child);
|
||||
}
|
||||
dir.putChild(name, newDir);
|
||||
dir.updateModTime();
|
||||
dir.putChild(name, newDir);
|
||||
newDir.setVersionID(getNextVersionID());
|
||||
}
|
||||
|
||||
@@ -306,8 +306,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
}
|
||||
PlainFileNodeImpl file = new PlainFileNodeImpl(this);
|
||||
file.setVersionID(getNextVersionID());
|
||||
dir.putChild(name, file);
|
||||
dir.updateModTime();
|
||||
dir.putChild(name, file);
|
||||
if (child != null)
|
||||
{
|
||||
file.setAncestor(child);
|
||||
@@ -341,8 +341,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
}
|
||||
PlainFileNodeImpl file = new PlainFileNodeImpl(this);
|
||||
file.setVersionID(getNextVersionID());
|
||||
dir.putChild(name, file);
|
||||
dir.updateModTime();
|
||||
dir.putChild(name, file);
|
||||
if (child != null)
|
||||
{
|
||||
file.setAncestor(child);
|
||||
@@ -381,8 +381,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
{
|
||||
newFile.setAncestor(child);
|
||||
}
|
||||
dir.putChild(name, newFile);
|
||||
dir.updateModTime();
|
||||
dir.putChild(name, newFile);
|
||||
newFile.setVersionID(getNextVersionID());
|
||||
}
|
||||
|
||||
|
@@ -37,11 +37,6 @@ public class ChildEntryImpl implements ChildEntry, Serializable
|
||||
*/
|
||||
private AVMNode fChild;
|
||||
|
||||
/**
|
||||
* Version for optimistic locking.
|
||||
*/
|
||||
private long fVers;
|
||||
|
||||
/**
|
||||
* Default constructor for Hibernate.
|
||||
*/
|
||||
@@ -126,20 +121,4 @@ public class ChildEntryImpl implements ChildEntry, Serializable
|
||||
{
|
||||
return fKey.hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter.
|
||||
*/
|
||||
public void setVers(long vers)
|
||||
{
|
||||
fVers = vers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter.
|
||||
*/
|
||||
public long getVers()
|
||||
{
|
||||
return fVers;
|
||||
}
|
||||
}
|
||||
|
@@ -139,14 +139,12 @@
|
||||
<property name="tag" type="string" length="255" column="tag"/>
|
||||
<property name="description" type="string" length="8192" column="description"/>
|
||||
</class>
|
||||
<class name="ChildEntryImpl" proxy="ChildEntry" table="avm_child_entries"
|
||||
optimistic-lock="version">
|
||||
<class name="ChildEntryImpl" proxy="ChildEntry" table="avm_child_entries">
|
||||
<cache usage="read-write"/>
|
||||
<composite-id name="key" class="ChildKey">
|
||||
<key-many-to-one name="parent" column="parent_id" class="DirectoryNodeImpl"/>
|
||||
<key-property name="name" column="name" type="string" length="160"/>
|
||||
</composite-id>
|
||||
<version name="vers" column="vers" type="long"/>
|
||||
<many-to-one name="child" column="child_id" class="AVMNodeImpl"
|
||||
not-null="true"/>
|
||||
</class>
|
||||
|
Reference in New Issue
Block a user