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:
@@ -154,7 +154,7 @@
|
|||||||
<ref bean="transactionComponent"/>
|
<ref bean="transactionComponent"/>
|
||||||
</property>
|
</property>
|
||||||
<property name="maxRetries">
|
<property name="maxRetries">
|
||||||
<value>10</value>
|
<value>20</value>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@
|
|||||||
<ref bean="readWriteTransactionDefinition"/>
|
<ref bean="readWriteTransactionDefinition"/>
|
||||||
</property>
|
</property>
|
||||||
<property name="maxRetries">
|
<property name="maxRetries">
|
||||||
<value>10</value>
|
<value>20</value>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@
|
|||||||
<ref bean="readOnlyTransactionDefinition"/>
|
<ref bean="readOnlyTransactionDefinition"/>
|
||||||
</property>
|
</property>
|
||||||
<property name="maxRetries">
|
<property name="maxRetries">
|
||||||
<value>10</value>
|
<value>20</value>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@ public class AVMCrawlTestP extends AVMServiceTestBase
|
|||||||
{
|
{
|
||||||
int n = 4; // Number of Threads.
|
int n = 4; // Number of Threads.
|
||||||
int m = 12; // How many multiples of content to start with.
|
int m = 12; // How many multiples of content to start with.
|
||||||
long runTime = 28800000; // 6 hours.
|
long runTime = 7200000; // 6 hours.
|
||||||
fService.purgeStore("main");
|
fService.purgeStore("main");
|
||||||
BulkLoader loader = new BulkLoader();
|
BulkLoader loader = new BulkLoader();
|
||||||
loader.setAvmService(fService);
|
loader.setAvmService(fService);
|
||||||
|
@@ -248,8 +248,8 @@ class AVMCrawler implements Runnable
|
|||||||
private String randomName()
|
private String randomName()
|
||||||
{
|
{
|
||||||
char [] chars = new char[2];
|
char [] chars = new char[2];
|
||||||
chars[0] = (char)('a' + fRandom.nextInt(26));
|
chars[0] = (char)('a' + fRandom.nextInt(12));
|
||||||
chars[1] = (char)('a' + fRandom.nextInt(26));
|
chars[1] = (char)('a' + fRandom.nextInt(12));
|
||||||
return new String(chars);
|
return new String(chars);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -687,8 +687,8 @@ public class AVMRepository
|
|||||||
{
|
{
|
||||||
dstNode.setAncestor(child);
|
dstNode.setAncestor(child);
|
||||||
}
|
}
|
||||||
dstDir.putChild(dstName, dstNode);
|
|
||||||
dstDir.updateModTime();
|
dstDir.updateModTime();
|
||||||
|
dstDir.putChild(dstName, dstNode);
|
||||||
if (child == null)
|
if (child == null)
|
||||||
{
|
{
|
||||||
dstNode.setAncestor(srcNode);
|
dstNode.setAncestor(srcNode);
|
||||||
|
@@ -237,8 +237,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
|||||||
{
|
{
|
||||||
newDir.setAncestor(child);
|
newDir.setAncestor(child);
|
||||||
}
|
}
|
||||||
dir.putChild(name, newDir);
|
|
||||||
dir.updateModTime();
|
dir.updateModTime();
|
||||||
|
dir.putChild(name, newDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -280,8 +280,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
|||||||
{
|
{
|
||||||
newDir.setAncestor(child);
|
newDir.setAncestor(child);
|
||||||
}
|
}
|
||||||
dir.putChild(name, newDir);
|
|
||||||
dir.updateModTime();
|
dir.updateModTime();
|
||||||
|
dir.putChild(name, newDir);
|
||||||
newDir.setVersionID(getNextVersionID());
|
newDir.setVersionID(getNextVersionID());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,8 +306,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
|||||||
}
|
}
|
||||||
PlainFileNodeImpl file = new PlainFileNodeImpl(this);
|
PlainFileNodeImpl file = new PlainFileNodeImpl(this);
|
||||||
file.setVersionID(getNextVersionID());
|
file.setVersionID(getNextVersionID());
|
||||||
dir.putChild(name, file);
|
|
||||||
dir.updateModTime();
|
dir.updateModTime();
|
||||||
|
dir.putChild(name, file);
|
||||||
if (child != null)
|
if (child != null)
|
||||||
{
|
{
|
||||||
file.setAncestor(child);
|
file.setAncestor(child);
|
||||||
@@ -341,8 +341,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
|||||||
}
|
}
|
||||||
PlainFileNodeImpl file = new PlainFileNodeImpl(this);
|
PlainFileNodeImpl file = new PlainFileNodeImpl(this);
|
||||||
file.setVersionID(getNextVersionID());
|
file.setVersionID(getNextVersionID());
|
||||||
dir.putChild(name, file);
|
|
||||||
dir.updateModTime();
|
dir.updateModTime();
|
||||||
|
dir.putChild(name, file);
|
||||||
if (child != null)
|
if (child != null)
|
||||||
{
|
{
|
||||||
file.setAncestor(child);
|
file.setAncestor(child);
|
||||||
@@ -381,8 +381,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
|||||||
{
|
{
|
||||||
newFile.setAncestor(child);
|
newFile.setAncestor(child);
|
||||||
}
|
}
|
||||||
dir.putChild(name, newFile);
|
|
||||||
dir.updateModTime();
|
dir.updateModTime();
|
||||||
|
dir.putChild(name, newFile);
|
||||||
newFile.setVersionID(getNextVersionID());
|
newFile.setVersionID(getNextVersionID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -37,11 +37,6 @@ public class ChildEntryImpl implements ChildEntry, Serializable
|
|||||||
*/
|
*/
|
||||||
private AVMNode fChild;
|
private AVMNode fChild;
|
||||||
|
|
||||||
/**
|
|
||||||
* Version for optimistic locking.
|
|
||||||
*/
|
|
||||||
private long fVers;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor for Hibernate.
|
* Default constructor for Hibernate.
|
||||||
*/
|
*/
|
||||||
@@ -126,20 +121,4 @@ public class ChildEntryImpl implements ChildEntry, Serializable
|
|||||||
{
|
{
|
||||||
return fKey.hashCode();
|
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="tag" type="string" length="255" column="tag"/>
|
||||||
<property name="description" type="string" length="8192" column="description"/>
|
<property name="description" type="string" length="8192" column="description"/>
|
||||||
</class>
|
</class>
|
||||||
<class name="ChildEntryImpl" proxy="ChildEntry" table="avm_child_entries"
|
<class name="ChildEntryImpl" proxy="ChildEntry" table="avm_child_entries">
|
||||||
optimistic-lock="version">
|
|
||||||
<cache usage="read-write"/>
|
<cache usage="read-write"/>
|
||||||
<composite-id name="key" class="ChildKey">
|
<composite-id name="key" class="ChildKey">
|
||||||
<key-many-to-one name="parent" column="parent_id" class="DirectoryNodeImpl"/>
|
<key-many-to-one name="parent" column="parent_id" class="DirectoryNodeImpl"/>
|
||||||
<key-property name="name" column="name" type="string" length="160"/>
|
<key-property name="name" column="name" type="string" length="160"/>
|
||||||
</composite-id>
|
</composite-id>
|
||||||
<version name="vers" column="vers" type="long"/>
|
|
||||||
<many-to-one name="child" column="child_id" class="AVMNodeImpl"
|
<many-to-one name="child" column="child_id" class="AVMNodeImpl"
|
||||||
not-null="true"/>
|
not-null="true"/>
|
||||||
</class>
|
</class>
|
||||||
|
Reference in New Issue
Block a user