mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)
103439: Fix ACE-3948: BM-0004: Factor out select on alf_content_url table during file creation - A plain file creation had 9 inserts and 1 select ... now it only has 9 inserts. - Switch to an optimistic insert during alf_content_url creation - Operations that reuse content URLs (copy, version) now get the redundant statement in the form of a snapshot-wrapped insert git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@103623 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -28,6 +28,7 @@ import org.alfresco.repo.cache.SimpleCache;
|
||||
import org.alfresco.repo.cache.lookup.EntityLookupCache;
|
||||
import org.alfresco.repo.cache.lookup.EntityLookupCache.EntityLookupCallbackDAOAdaptor;
|
||||
import org.alfresco.repo.content.cleanup.EagerContentStoreCleaner;
|
||||
import org.alfresco.repo.domain.control.ControlDAO;
|
||||
import org.alfresco.repo.domain.encoding.EncodingDAO;
|
||||
import org.alfresco.repo.domain.locale.LocaleDAO;
|
||||
import org.alfresco.repo.domain.mimetype.MimetypeDAO;
|
||||
@@ -69,6 +70,7 @@ public abstract class AbstractContentDataDAOImpl implements ContentDataDAO
|
||||
|
||||
private final ContentDataCallbackDAO contentDataCallbackDAO;
|
||||
private final ContentUrlCallbackDAO contentUrlCallbackDAO;
|
||||
protected ControlDAO controlDAO;
|
||||
protected MimetypeDAO mimetypeDAO;
|
||||
protected EncodingDAO encodingDAO;
|
||||
protected LocaleDAO localeDAO;
|
||||
@@ -95,6 +97,11 @@ public abstract class AbstractContentDataDAOImpl implements ContentDataDAO
|
||||
this.contentUrlCache = new EntityLookupCache<Long, ContentUrlEntity, String>(contentUrlCallbackDAO);
|
||||
}
|
||||
|
||||
public void setControlDAO(ControlDAO controlDAO)
|
||||
{
|
||||
this.controlDAO = controlDAO;
|
||||
}
|
||||
|
||||
public void setMimetypeDAO(MimetypeDAO mimetypeDAO)
|
||||
{
|
||||
this.mimetypeDAO = mimetypeDAO;
|
||||
@@ -440,7 +447,7 @@ public abstract class AbstractContentDataDAOImpl implements ContentDataDAO
|
||||
ContentUrlEntity contentUrlEntity = new ContentUrlEntity();
|
||||
contentUrlEntity.setContentUrl(contentUrl);
|
||||
contentUrlEntity.setSize(size);
|
||||
Pair<Long, ContentUrlEntity> pair = contentUrlCache.getOrCreateByValue(contentUrlEntity);
|
||||
Pair<Long, ContentUrlEntity> pair = contentUrlCache.createOrGetByValue(contentUrlEntity, controlDAO);
|
||||
contentUrlId = pair.getFirst();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user