Added pessimistic locking in several places to shut down deadlocks.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3252 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-06-26 16:43:35 +00:00
parent 64288d531d
commit c6dfeb1c9d
10 changed files with 72 additions and 31 deletions

View File

@@ -126,14 +126,15 @@ class PlainDirectoryNodeImpl extends DirectoryNodeImpl implements PlainDirectory
* @param lPath The lookup path so far.
* @param name The name to lookup.
* @param version The version to look under.
* @param write Whether this is in a write context.
* @return The child or null.
*/
@SuppressWarnings("unchecked")
public AVMNode lookupChild(Lookup lPath, String name, int version)
public AVMNode lookupChild(Lookup lPath, String name, int version, boolean write)
{
// We're doing the hand unrolling of the proxy because
// Hibernate/CGLIB proxies are broken.
ChildEntry entry = getChild(name);
ChildEntry entry = getChild(name, write);
if (entry == null)
{
return null;
@@ -153,7 +154,7 @@ class PlainDirectoryNodeImpl extends DirectoryNodeImpl implements PlainDirectory
{
throw new AVMBadArgumentException("Path is null.");
}
ChildEntry entry = getChild(name);
ChildEntry entry = getChild(name, false);
if (entry == null)
{
return null;
@@ -168,7 +169,7 @@ class PlainDirectoryNodeImpl extends DirectoryNodeImpl implements PlainDirectory
@SuppressWarnings("unchecked")
public void removeChild(String name)
{
ChildEntry entry = getChild(name);
ChildEntry entry = getChild(name, true);
if (entry != null)
{
SuperRepository.GetInstance().getSession().delete(entry);