mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
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:
@@ -19,6 +19,7 @@ package org.alfresco.repo.avm;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.LockMode;
|
||||
import org.hibernate.Query;
|
||||
import org.hibernate.Session;
|
||||
|
||||
@@ -49,13 +50,16 @@ abstract class DirectoryNodeImpl extends AVMNodeImpl implements DirectoryNode
|
||||
/**
|
||||
* Retrieves the ChildEntry in this directory with the given name.
|
||||
* @param name The name to look for.
|
||||
* @param write Whether the child should be looked up for writing.
|
||||
* @return The ChildEntry or null if not found.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
protected ChildEntry getChild(String name)
|
||||
protected ChildEntry getChild(String name, boolean write)
|
||||
{
|
||||
Session sess = SuperRepository.GetInstance().getSession();
|
||||
return (ChildEntry)sess.get(ChildEntryImpl.class, new ChildEntryImpl(name, this, null));
|
||||
ChildEntry entry = (ChildEntry)sess.get(ChildEntryImpl.class, new ChildEntryImpl(name, this, null),
|
||||
(write && getIsNew()) ? LockMode.UPGRADE : LockMode.READ);
|
||||
return entry;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user