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:
@@ -61,6 +61,7 @@ public class FixNameCrcValuesPatch extends AbstractPatch
|
||||
private static final String MSG_SUCCESS = "patch.fixNameCrcValues.result";
|
||||
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_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_CHILD = "patch.fixNameCrcValues.associationTypeNotChild";
|
||||
|
||||
@@ -282,6 +283,14 @@ public class FixNameCrcValuesPatch extends AbstractPatch
|
||||
String childNodeName = (String) row.get("childNodeName");
|
||||
// Use the UUID if there is no cm:name
|
||||
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
|
||||
QName typeQName = qnameDAO.getQName(typeQNameId).getSecond();
|
||||
String namespace = qnameDAO.getNamespace(qnameNamespaceId).getSecond();
|
||||
|
Reference in New Issue
Block a user