mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-16 17:55:15 +00:00
Various changes to keep Hibernate session caches from growing without bound.
Deleting AVM locks is considerably faster which makes large submits faster. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6935 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
parent
2a47726733
commit
4489bd0a22
@ -62,4 +62,10 @@ public interface AttributeDAO
|
||||
* @param query
|
||||
*/
|
||||
public void delete(MapAttribute map, AttrQuery query);
|
||||
|
||||
/**
|
||||
* Evict an Attribute from the session cache.
|
||||
* @param attr
|
||||
*/
|
||||
public void evict(Attribute attr);
|
||||
}
|
||||
|
@ -192,7 +192,9 @@ public class AttributeServiceImpl implements AttributeService
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return fAttributeConverter.toValue(found);
|
||||
Attribute converted = fAttributeConverter.toValue(found);
|
||||
fAttributeDAO.evict(found);
|
||||
return converted;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@ -251,7 +253,9 @@ public class AttributeServiceImpl implements AttributeService
|
||||
{
|
||||
throw new AVMWrongTypeException("Not a Map: " + keys);
|
||||
}
|
||||
found.put(name, fAttributeConverter.toPersistent(value));
|
||||
Attribute converted = fAttributeConverter.toPersistent(value);
|
||||
found.put(name, converted);
|
||||
fAttributeDAO.evict(converted);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@ -480,7 +484,9 @@ public class AttributeServiceImpl implements AttributeService
|
||||
{
|
||||
throw new AVMWrongTypeException("Attribute Not List: " + keys);
|
||||
}
|
||||
Attribute converted = fAttributeConverter.toPersistent(value);
|
||||
found.set(index, fAttributeConverter.toPersistent(value));
|
||||
fAttributeDAO.evict(converted);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -43,6 +43,8 @@ import org.alfresco.repo.attributes.Attribute.Type;
|
||||
import org.alfresco.service.cmr.attributes.AttrQuery;
|
||||
import org.alfresco.service.cmr.attributes.AttrQueryHelper;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.hibernate.Query;
|
||||
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
|
||||
|
||||
@ -53,6 +55,8 @@ import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
|
||||
public class AttributeDAOHibernate extends HibernateDaoSupport implements
|
||||
AttributeDAO
|
||||
{
|
||||
private static Log fgLogger = LogFactory.getLog(AttributeDAOHibernate.class);
|
||||
|
||||
private MapEntryDAO fMapEntryDAO;
|
||||
|
||||
private ListEntryDAO fListEntryDAO;
|
||||
@ -83,6 +87,7 @@ public class AttributeDAOHibernate extends HibernateDaoSupport implements
|
||||
for (MapEntry entry : mapEntries)
|
||||
{
|
||||
Attribute subAttr = entry.getAttribute();
|
||||
getSession().evict(entry);
|
||||
fMapEntryDAO.delete(entry);
|
||||
delete(subAttr);
|
||||
}
|
||||
@ -94,10 +99,16 @@ public class AttributeDAOHibernate extends HibernateDaoSupport implements
|
||||
for (ListEntry entry : listEntries)
|
||||
{
|
||||
Attribute subAttr = entry.getAttribute();
|
||||
getSession().evict(entry);
|
||||
fListEntryDAO.delete(entry);
|
||||
delete(subAttr);
|
||||
}
|
||||
}
|
||||
if (fgLogger.isDebugEnabled())
|
||||
{
|
||||
fgLogger.debug("Entities: " + getSession().getStatistics().getEntityCount());
|
||||
}
|
||||
getSession().evict(attr);
|
||||
getSession().delete(attr);
|
||||
}
|
||||
|
||||
@ -144,4 +155,26 @@ public class AttributeDAOHibernate extends HibernateDaoSupport implements
|
||||
{
|
||||
getSession().save(attr);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.attributes.AttributeDAO#evict(org.alfresco.repo.attributes.Attribute)
|
||||
*/
|
||||
public void evict(Attribute attr)
|
||||
{
|
||||
if (attr.getType() == Attribute.Type.MAP)
|
||||
{
|
||||
for (Attribute child : attr.values())
|
||||
{
|
||||
evict(child);
|
||||
}
|
||||
}
|
||||
if (attr.getType() == Attribute.Type.LIST)
|
||||
{
|
||||
for (Attribute child : attr)
|
||||
{
|
||||
evict(child);
|
||||
}
|
||||
}
|
||||
getSession().evict(attr);
|
||||
}
|
||||
}
|
||||
|
@ -119,4 +119,10 @@ public interface AVMNodeDAO
|
||||
* @return
|
||||
*/
|
||||
List<LayeredFileNode> getNullVersionLayeredFiles(int count);
|
||||
|
||||
/**
|
||||
* Evict an AVMNode that is no longer going to be used.
|
||||
* @param node
|
||||
*/
|
||||
public void evict(AVMNode node);
|
||||
}
|
||||
|
@ -339,7 +339,10 @@ public class AVMRepository
|
||||
}
|
||||
dir.putChild(name, child);
|
||||
fLookupCache.onWrite(pathParts[0]);
|
||||
return child.getDescriptor(parent.getPath(), name, parent.getIndirection(), parent.getIndirectionVersion());
|
||||
AVMNodeDescriptor desc = child.getDescriptor(parent.getPath(), name, parent.getIndirection(), parent.getIndirectionVersion());
|
||||
fAVMNodeDAO.flush();
|
||||
fAVMNodeDAO.evict(child);
|
||||
return desc;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2481,6 +2484,7 @@ public class AVMRepository
|
||||
LayeredDirectoryNode dir = (LayeredDirectoryNode)node;
|
||||
dir.flatten(name);
|
||||
fAVMNodeDAO.flush();
|
||||
fAVMNodeDAO.evict(dir);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@ -2511,7 +2515,10 @@ public class AVMRepository
|
||||
throw new AVMNotFoundException("Path not found.");
|
||||
}
|
||||
AVMNode node = lPath.getCurrentNode();
|
||||
return node.getDescriptor(lPath);
|
||||
AVMNodeDescriptor desc = node.getDescriptor(lPath);
|
||||
fAVMNodeDAO.flush();
|
||||
fAVMNodeDAO.evict(node);
|
||||
return desc;
|
||||
}
|
||||
finally
|
||||
{
|
||||
@ -2730,6 +2737,8 @@ public class AVMRepository
|
||||
{
|
||||
throw new AVMNotFoundException("Node not found: " + desc);
|
||||
}
|
||||
return node.getAspects();
|
||||
Set<QName> aspects = node.getAspects();
|
||||
fAVMNodeDAO.evict(node);
|
||||
return aspects;
|
||||
}
|
||||
}
|
||||
|
@ -361,6 +361,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
{
|
||||
newDir.getProperties().putAll(properties);
|
||||
}
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(newDir);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -405,6 +407,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
}
|
||||
dir.updateModTime();
|
||||
dir.putChild(name, newDir);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(newDir);
|
||||
// newDir.setVersionID(getNextVersionID());
|
||||
}
|
||||
|
||||
@ -441,6 +445,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
-1,
|
||||
"UTF-8"));
|
||||
ContentWriter writer = createContentWriter(AVMNodeConverter.ExtendAVMPath(path, name));
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(file);
|
||||
return writer.getContentOutputStream();
|
||||
}
|
||||
|
||||
@ -484,11 +490,11 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
{
|
||||
file.getProperties().putAll(properties);
|
||||
}
|
||||
ContentWriter writer = createContentWriter(AVMNodeConverter.ExtendAVMPath(path, name));
|
||||
// Yet another flush.
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
ContentWriter writer = createContentWriter(AVMNodeConverter.ExtendAVMPath(path, name));
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(file);
|
||||
writer.putContent(data);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -520,6 +526,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
}
|
||||
dir.updateModTime();
|
||||
dir.putChild(name, newFile);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(newFile);
|
||||
// newFile.setVersionID(getNextVersionID());
|
||||
}
|
||||
|
||||
@ -625,6 +633,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
AVMNode child = AVMNodeUnwrapper.Unwrap(listing.get(name));
|
||||
AVMNodeDescriptor desc = child.getDescriptor(lPath, name);
|
||||
results.put(name, desc);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(child);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
@ -643,7 +652,10 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
throw new AVMNotFoundException("Path " + path + " not found.");
|
||||
}
|
||||
DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode();
|
||||
return dir.getDeletedNames();
|
||||
List<String> deleted = dir.getDeletedNames();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(dir);
|
||||
return deleted;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -676,6 +688,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
}
|
||||
dir.removeChild(lPath, name);
|
||||
dir.updateModTime();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(dir);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -697,6 +711,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
}
|
||||
((LayeredDirectoryNode)node).uncover(lPath, name);
|
||||
node.updateModTime();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(node);
|
||||
}
|
||||
|
||||
// TODO This is problematic. As time goes on this returns
|
||||
@ -866,6 +882,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
}
|
||||
dir.turnPrimary(lPath);
|
||||
dir.updateModTime();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(dir);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -887,6 +905,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
}
|
||||
dir.retarget(lPath, target);
|
||||
dir.updateModTime();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(dir);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1060,6 +1080,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
}
|
||||
((LayeredDirectoryNode)node).setOpacity(opacity);
|
||||
node.updateModTime();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(node);
|
||||
}
|
||||
|
||||
// TODO Does it make sense to set properties on DeletedNodes?
|
||||
@ -1079,6 +1101,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
AVMNode node = lPath.getCurrentNode();
|
||||
node.setProperty(name, value);
|
||||
node.setGuid(GUID.generate());
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(node);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1096,6 +1120,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
AVMNode node = lPath.getCurrentNode();
|
||||
node.addProperties(properties);
|
||||
node.setGuid(GUID.generate());
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(node);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1113,7 +1139,10 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
throw new AVMNotFoundException("Path " + path + " not found.");
|
||||
}
|
||||
AVMNode node = lPath.getCurrentNode();
|
||||
return node.getProperty(name);
|
||||
PropertyValue prop = node.getProperty(name);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(node);
|
||||
return prop;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1130,7 +1159,10 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
throw new AVMNotFoundException("Path " + path + " not found.");
|
||||
}
|
||||
AVMNode node = lPath.getCurrentNode();
|
||||
return node.getProperties();
|
||||
Map<QName, PropertyValue> props = node.getProperties();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(node);
|
||||
return props;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1148,6 +1180,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
AVMNode node = lPath.getCurrentNode();
|
||||
node.setGuid(GUID.generate());
|
||||
node.deleteProperty(name);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(node);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1164,6 +1198,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
AVMNode node = lPath.getCurrentNode();
|
||||
node.setGuid(GUID.generate());
|
||||
node.deleteProperties();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(node);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1250,7 +1286,10 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
{
|
||||
throw new AVMWrongTypeException("File Expected.");
|
||||
}
|
||||
return ((FileNode)node).getContentData(lPath);
|
||||
ContentData content = ((FileNode)node).getContentData(lPath);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(node);
|
||||
return content;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1272,7 +1311,10 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
}
|
||||
node.updateModTime();
|
||||
node.setGuid(GUID.generate());
|
||||
return ((FileNode)node).getContentData(lPath);
|
||||
ContentData content = ((FileNode)node).getContentData(lPath);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(node);
|
||||
return content;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1293,6 +1335,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
throw new AVMWrongTypeException("File Expected.");
|
||||
}
|
||||
((FileNode)node).setContentData(data);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(node);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1310,6 +1354,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
AVMNode node = lPath.getCurrentNode();
|
||||
node.copyMetaDataFrom(from);
|
||||
node.setGuid(GUID.generate());
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(node);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1327,6 +1373,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
AVMNode node = lPath.getCurrentNode();
|
||||
node.getAspects().add(aspectName);
|
||||
node.setGuid(GUID.generate());
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(node);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1343,7 +1391,10 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
throw new AVMNotFoundException("Path " + path + " not found.");
|
||||
}
|
||||
AVMNode node = lPath.getCurrentNode();
|
||||
return node.getAspects();
|
||||
Set<QName> aspects = node.getAspects();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(node);
|
||||
return aspects;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1368,6 +1419,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
node.getProperties().remove(name);
|
||||
}
|
||||
node.setGuid(GUID.generate());
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(node);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1385,7 +1438,9 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
throw new AVMNotFoundException("Path " + path + " not found.");
|
||||
}
|
||||
AVMNode node = lPath.getCurrentNode();
|
||||
return node.getAspects().contains(aspectName);
|
||||
boolean has = node.getAspects().contains(aspectName);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(node);
|
||||
return has;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1403,6 +1458,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
AVMNode node = lPath.getCurrentNode();
|
||||
node.setAcl(acl);
|
||||
node.setGuid(GUID.generate());
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(node);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1436,6 +1493,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
}
|
||||
DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode();
|
||||
dir.link(lPath, name, toLink);
|
||||
//AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
//AVMDAOs.Instance().fAVMNodeDAO.evict(dir);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1473,6 +1532,9 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
toLink.getAspects().add(WCMModel.ASPECT_REVERTED);
|
||||
PropertyValue value = new PropertyValue(null, toRevertTo.getId());
|
||||
toLink.setProperty(WCMModel.PROP_REVERTED_ID, value);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(dir);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(toLink);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@ -1487,6 +1549,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
}
|
||||
AVMNode node = lPath.getCurrentNode();
|
||||
node.setGuid(guid);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(node);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@ -1506,6 +1570,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
}
|
||||
PlainFileNode file = (PlainFileNode)node;
|
||||
file.setEncoding(encoding);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(file);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@ -1525,5 +1591,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
}
|
||||
PlainFileNode file = (PlainFileNode)node;
|
||||
file.setMimeType(mimeType);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(file);
|
||||
}
|
||||
}
|
||||
|
@ -84,4 +84,10 @@ public interface ChildEntryDAO
|
||||
* @param parent The parent.
|
||||
*/
|
||||
public void deleteByParent(AVMNode parent);
|
||||
|
||||
/**
|
||||
* Evict a child entry.
|
||||
* @param entry
|
||||
*/
|
||||
public void evict(ChildEntry entry);
|
||||
}
|
||||
|
@ -402,6 +402,7 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
|
||||
{
|
||||
listing.put(entry.getKey().getName(), entry.getChild());
|
||||
}
|
||||
AVMDAOs.Instance().fChildEntryDAO.evict(entry);
|
||||
}
|
||||
return listing;
|
||||
}
|
||||
@ -420,6 +421,7 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
|
||||
{
|
||||
listing.put(entry.getKey().getName(), entry.getChild());
|
||||
}
|
||||
AVMDAOs.Instance().fChildEntryDAO.evict(entry);
|
||||
}
|
||||
return listing;
|
||||
}
|
||||
@ -445,6 +447,8 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
|
||||
AVMNodeDescriptor childDesc =
|
||||
childNode.getDescriptor(dir.getPath(), child.getKey().getName(), dir.getIndirection(), dir.getIndirectionVersion());
|
||||
listing.put(child.getKey().getName(), childDesc);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(childNode);
|
||||
AVMDAOs.Instance().fChildEntryDAO.evict(child);
|
||||
}
|
||||
return listing;
|
||||
}
|
||||
@ -477,6 +481,7 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
|
||||
listing.get(name).getDescriptor(dir.getPath(), name,
|
||||
lookup.getCurrentIndirection(),
|
||||
lookup.getCurrentIndirectionVersion()));
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(listing.get(name));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -494,6 +499,8 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
|
||||
child.getKey().getName(),
|
||||
dir.getIndirection(),
|
||||
dir.getIndirectionVersion()));
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(child.getChild());
|
||||
AVMDAOs.Instance().fChildEntryDAO.evict(child);
|
||||
}
|
||||
}
|
||||
return baseListing;
|
||||
@ -582,10 +589,13 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return entry.getChild().getDescriptor(mine.getPath(),
|
||||
name,
|
||||
mine.getIndirection(),
|
||||
mine.getIndirectionVersion());
|
||||
AVMNodeDescriptor desc = entry.getChild().getDescriptor(mine.getPath(),
|
||||
name,
|
||||
mine.getIndirection(),
|
||||
mine.getIndirectionVersion());
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(entry.getChild());
|
||||
AVMDAOs.Instance().fChildEntryDAO.evict(entry);
|
||||
return desc;
|
||||
}
|
||||
// If we are opaque don't check underneath.
|
||||
if (fOpacity)
|
||||
@ -601,7 +611,9 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return child.getFirst().getDescriptor(lookup);
|
||||
AVMNodeDescriptor desc = child.getFirst().getDescriptor(lookup);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(child.getFirst());
|
||||
return desc;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -114,6 +114,7 @@ public class LookupCache
|
||||
{
|
||||
return null;
|
||||
}
|
||||
dir = (DirectoryNode)AVMNodeUnwrapper.Unwrap(dir);
|
||||
// Add an entry for the root.
|
||||
result.add(dir, "", true, write);
|
||||
dir = (DirectoryNode)result.getCurrentNode();
|
||||
|
@ -114,7 +114,8 @@ class PlainDirectoryNodeImpl extends DirectoryNodeImpl implements PlainDirectory
|
||||
{
|
||||
continue;
|
||||
}
|
||||
result.put(child.getKey().getName(), child.getChild());
|
||||
result.put(child.getKey().getName(), AVMNodeUnwrapper.Unwrap(child.getChild()));
|
||||
AVMDAOs.Instance().fChildEntryDAO.evict(child);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -165,6 +166,8 @@ class PlainDirectoryNodeImpl extends DirectoryNodeImpl implements PlainDirectory
|
||||
child.getKey().getName(),
|
||||
dir.getIndirection(),
|
||||
dir.getIndirectionVersion()));
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(child.getChild());
|
||||
AVMDAOs.Instance().fChildEntryDAO.evict(child);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -219,7 +222,10 @@ class PlainDirectoryNodeImpl extends DirectoryNodeImpl implements PlainDirectory
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return entry.getChild().getDescriptor(mine.getPath(), name, (String)null, -1);
|
||||
AVMNodeDescriptor desc = entry.getChild().getDescriptor(mine.getPath(), name, (String)null, -1);
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(entry.getChild());
|
||||
AVMDAOs.Instance().fChildEntryDAO.evict(entry);
|
||||
return desc;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -209,4 +209,12 @@ class AVMNodeDAOHibernate extends HibernateDaoSupport implements
|
||||
query.setMaxResults(count);
|
||||
return (List<LayeredFileNode>)query.list();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.avm.AVMNodeDAO#evict(org.alfresco.repo.avm.AVMNode)
|
||||
*/
|
||||
public void evict(AVMNode node)
|
||||
{
|
||||
getSession().evict(node);
|
||||
}
|
||||
}
|
||||
|
@ -142,4 +142,12 @@ class ChildEntryDAOHibernate extends HibernateDaoSupport implements
|
||||
delete.setEntity("parent", parent);
|
||||
delete.executeUpdate();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.avm.ChildEntryDAO#evict(org.alfresco.repo.avm.ChildEntry)
|
||||
*/
|
||||
public void evict(ChildEntry entry)
|
||||
{
|
||||
getSession().evict(entry);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user