mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Tweaks for ALF-4529: Database connection problems when upgrading large sample 2.1.x data set
- Handle invalid child association QNames - Optimization on an array copy git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@23238 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -306,6 +306,7 @@ patch.fixNameCrcValues.description=Fixes name and qname CRC32 values to match UT
|
|||||||
patch.fixNameCrcValues.result=Fixed CRC32 values for UTF-8 encoding for {0} node child associations. See file {1} for details.
|
patch.fixNameCrcValues.result=Fixed CRC32 values for UTF-8 encoding for {0} node child associations. See file {1} for details.
|
||||||
patch.fixNameCrcValues.fixed=Updated CRC32 values for association ID {0}, name ''{1}'': {2} -> {3}, qname ''{4}'': {5} -> {6}.
|
patch.fixNameCrcValues.fixed=Updated CRC32 values for association ID {0}, name ''{1}'': {2} -> {3}, qname ''{4}'': {5} -> {6}.
|
||||||
patch.fixNameCrcValues.unableToChange=Failed to update the CRC32 value for association ID {0}: \n Node name: {1} \n name CRC old: {2} \n name CRC new: {3} \n qname: {4} \n qname CRC old: {5} \n qname CRC new: {6} \n Error: {7}
|
patch.fixNameCrcValues.unableToChange=Failed to update the CRC32 value for association ID {0}: \n Node name: {1} \n name CRC old: {2} \n name CRC new: {3} \n qname: {4} \n qname CRC old: {5} \n qname CRC new: {6} \n Error: {7}
|
||||||
|
patch.fixNameCrcValues.fixingLocalname=Fixing invalid localname for association ID {0}: \n Was: ''{1}'' \n Now: ''{2}''
|
||||||
patch.fixNameCrcValues.associationTypeNotDefined=Association type ''{0}'' has not been defined for child association ID {1}.
|
patch.fixNameCrcValues.associationTypeNotDefined=Association type ''{0}'' has not been defined for child association ID {1}.
|
||||||
patch.fixNameCrcValues.associationTypeNotChild=Association type ''{0}'' does not represent a child association but is used as one; for child association ID {1}.
|
patch.fixNameCrcValues.associationTypeNotChild=Association type ''{0}'' does not represent a child association but is used as one; for child association ID {1}.
|
||||||
|
|
||||||
|
@@ -61,6 +61,7 @@ public class FixNameCrcValuesPatch extends AbstractPatch
|
|||||||
private static final String MSG_SUCCESS = "patch.fixNameCrcValues.result";
|
private static final String MSG_SUCCESS = "patch.fixNameCrcValues.result";
|
||||||
private static final String MSG_REWRITTEN = "patch.fixNameCrcValues.fixed";
|
private static final String MSG_REWRITTEN = "patch.fixNameCrcValues.fixed";
|
||||||
private static final String MSG_UNABLE_TO_CHANGE = "patch.fixNameCrcValues.unableToChange";
|
private static final String MSG_UNABLE_TO_CHANGE = "patch.fixNameCrcValues.unableToChange";
|
||||||
|
private static final String MSG_FIXING_LOCALNAME = "patch.fixNameCrcValues.fixingLocalname";
|
||||||
private static final String ERR_ASSOCIATION_TYPE_NOT_DEFINED = "patch.fixNameCrcValues.associationTypeNotDefined";
|
private static final String ERR_ASSOCIATION_TYPE_NOT_DEFINED = "patch.fixNameCrcValues.associationTypeNotDefined";
|
||||||
private static final String ERR_ASSOCIATION_TYPE_NOT_CHILD = "patch.fixNameCrcValues.associationTypeNotChild";
|
private static final String ERR_ASSOCIATION_TYPE_NOT_CHILD = "patch.fixNameCrcValues.associationTypeNotChild";
|
||||||
|
|
||||||
@@ -282,6 +283,14 @@ public class FixNameCrcValuesPatch extends AbstractPatch
|
|||||||
String childNodeName = (String) row.get("childNodeName");
|
String childNodeName = (String) row.get("childNodeName");
|
||||||
// Use the UUID if there is no cm:name
|
// Use the UUID if there is no cm:name
|
||||||
childNodeName = (childNodeName == null) ? childNodeUuid : childNodeName;
|
childNodeName = (childNodeName == null) ? childNodeUuid : childNodeName;
|
||||||
|
// Ensure that we generate a valid QName (see comments on ALF-4529)
|
||||||
|
if (qnameLocalName == null || qnameLocalName.length() == 0)
|
||||||
|
{
|
||||||
|
String qnameLocalNameNew = "fix-" + assocId;
|
||||||
|
logger.warn(
|
||||||
|
I18NUtil.getMessage(MSG_FIXING_LOCALNAME, assocId, qnameLocalName, qnameLocalNameNew));
|
||||||
|
qnameLocalName = qnameLocalNameNew;
|
||||||
|
}
|
||||||
// Resolve QNames
|
// Resolve QNames
|
||||||
QName typeQName = qnameDAO.getQName(typeQNameId).getSecond();
|
QName typeQName = qnameDAO.getQName(typeQNameId).getSecond();
|
||||||
String namespace = qnameDAO.getNamespace(qnameNamespaceId).getSecond();
|
String namespace = qnameDAO.getNamespace(qnameNamespaceId).getSecond();
|
||||||
|
@@ -415,6 +415,12 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<Map<String, Object>> rows = template.queryForList(SELECT_CHILD_ASSOCS_FOR_CRCS, entity, 0, queryMaxResults);
|
List<Map<String, Object>> rows = template.queryForList(SELECT_CHILD_ASSOCS_FOR_CRCS, entity, 0, queryMaxResults);
|
||||||
|
if (results.size() == 0 && rows.size() >= maxResults)
|
||||||
|
{
|
||||||
|
// We have all we need
|
||||||
|
results = rows;
|
||||||
|
break;
|
||||||
|
}
|
||||||
// Add these rows to the result
|
// Add these rows to the result
|
||||||
results.addAll(rows);
|
results.addAll(rows);
|
||||||
// Calculate new maxResults
|
// Calculate new maxResults
|
||||||
|
Reference in New Issue
Block a user