Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)

89043: Merged V4.2-BUG-FIX (4.2.4) to HEAD-BUG-FIX (5.0/Cloud)
      88875: Merged DEV (4.2.4) to V4.2-BUG-FIX (4.2.4)
         88823: MNT-12587: MySQL: Query to retrieve orphaned content URLs can cause memory issues
         Added fetchSize parameter to select_ContentUrlsOrphaned query for MySQL.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@94598 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-01-31 10:33:01 +00:00
parent e1e306d219
commit 80db2b1110
5 changed files with 56 additions and 17 deletions

View File

@@ -199,6 +199,7 @@ Inbound settings from iBatis
<mapper resource="alfresco/ibatis/#resource.dialect#/locks-common-SqlMap.xml"/> <mapper resource="alfresco/ibatis/#resource.dialect#/locks-common-SqlMap.xml"/>
<mapper resource="alfresco/ibatis/#resource.dialect#/locks-insert-SqlMap.xml"/> <mapper resource="alfresco/ibatis/#resource.dialect#/locks-insert-SqlMap.xml"/>
<mapper resource="alfresco/ibatis/#resource.dialect#/content-common-SqlMap.xml"/> <mapper resource="alfresco/ibatis/#resource.dialect#/content-common-SqlMap.xml"/>
<mapper resource="alfresco/ibatis/#resource.dialect#/content-select-SqlMap.xml"/>
<mapper resource="alfresco/ibatis/#resource.dialect#/content-insert-SqlMap.xml"/> <mapper resource="alfresco/ibatis/#resource.dialect#/content-insert-SqlMap.xml"/>
<mapper resource="alfresco/ibatis/#resource.dialect#/node-common-SqlMap.xml"/> <mapper resource="alfresco/ibatis/#resource.dialect#/node-common-SqlMap.xml"/>
<mapper resource="alfresco/ibatis/#resource.dialect#/node-select-children-SqlMap.xml"/> <mapper resource="alfresco/ibatis/#resource.dialect#/node-select-children-SqlMap.xml"/>

View File

@@ -271,22 +271,6 @@
cd.id is null cd.id is null
</select> </select>
<!-- Get content URL entities that were orphaned before a give time -->
<select id="select_ContentUrlsOrphaned" parameterType="ContentUrlOrphanQuery" resultMap="result_ContentUrl">
<![CDATA[
select
cu.*
from
alf_content_url cu
left outer join alf_content_data cd on (cd.content_url_id = cu.id)
where
cd.id is null and
cu.orphan_time > 0 and
cu.orphan_time < #{maxOrphanTimeExclusive} and
cu.orphan_time is not null
]]>
</select>
<!-- Update a specific mimetype --> <!-- Update a specific mimetype -->
<update id="update_Mimetype" parameterType="Mimetype"> <update id="update_Mimetype" parameterType="Mimetype">
update update

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!--
Select statements that require proper size limiting on the DB side
Dialect: Generic
-->
<mapper namespace="alfresco.content.select">
<!-- Get content URL entities that were orphaned before a give time -->
<select id="select_ContentUrlsOrphaned" parameterType="ContentUrlOrphanQuery" resultMap="result_ContentUrl">
<![CDATA[
select
cu.*
from
alf_content_url cu
left outer join alf_content_data cd on (cd.content_url_id = cu.id)
where
cd.id is null and
cu.orphan_time > 0 and
cu.orphan_time < #{maxOrphanTimeExclusive} and
cu.orphan_time is not null
]]>
</select>
</mapper>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!--
Select statements that require proper size limiting on the DB side
Dialect: MySQL
-->
<mapper namespace="alfresco.content.select">
<!-- Get content URL entities that were orphaned before a give time -->
<select id="select_ContentUrlsOrphaned" fetchSize="-2147483648" parameterType="ContentUrlOrphanQuery" resultMap="result_ContentUrl">
<![CDATA[
select
cu.*
from
alf_content_url cu
left outer join alf_content_data cd on (cd.content_url_id = cu.id)
where
cd.id is null and
cu.orphan_time > 0 and
cu.orphan_time < #{maxOrphanTimeExclusive} and
cu.orphan_time is not null
]]>
</select>
</mapper>

View File

@@ -56,7 +56,7 @@ public class ContentDataDAOImpl extends AbstractContentDataDAOImpl
private static final String SELECT_CONTENT_URL_BY_ID = "alfresco.content.select_ContentUrlById"; private static final String SELECT_CONTENT_URL_BY_ID = "alfresco.content.select_ContentUrlById";
private static final String SELECT_CONTENT_URL_BY_KEY = "alfresco.content.select_ContentUrlByKey"; private static final String SELECT_CONTENT_URL_BY_KEY = "alfresco.content.select_ContentUrlByKey";
private static final String SELECT_CONTENT_URL_BY_KEY_UNREFERENCED = "alfresco.content.select_ContentUrlByKeyUnreferenced"; private static final String SELECT_CONTENT_URL_BY_KEY_UNREFERENCED = "alfresco.content.select_ContentUrlByKeyUnreferenced";
private static final String SELECT_CONTENT_URLS_ORPHANED = "alfresco.content.select_ContentUrlsOrphaned"; private static final String SELECT_CONTENT_URLS_ORPHANED = "alfresco.content.select.select_ContentUrlsOrphaned";
private static final String SELECT_CONTENT_DATA_BY_ID = "alfresco.content.select_ContentDataById"; private static final String SELECT_CONTENT_DATA_BY_ID = "alfresco.content.select_ContentDataById";
private static final String SELECT_CONTENT_DATA_BY_NODE_AND_QNAME = "alfresco.content.select_ContentDataByNodeAndQName"; private static final String SELECT_CONTENT_DATA_BY_NODE_AND_QNAME = "alfresco.content.select_ContentDataByNodeAndQName";
private static final String SELECT_CONTENT_DATA_BY_NODE_IDS = "alfresco.content.select_ContentDataByNodeIds"; private static final String SELECT_CONTENT_DATA_BY_NODE_IDS = "alfresco.content.select_ContentDataByNodeIds";