Merged V2.2 to HEAD (V2.1 sourced)

7127: Merged V2.1 to V2.2
      7118: Fixed overly-eager applicability of patches brought forward from previous releases
      7119: Fixed SQL script patch schema numbering
   7245: Merged V2.1 to V2.2:
      7238: Serializes alfresco->alfresco deployments to the same target.
      7241: Added AVM index tracking into the built-in, cron-controlled config.
      7242: More DEBUG messages for index tracking, where required.
      7243: Fix for url encoding issue as found by by Ishii Akinori
   7372: Merged V2.1 to V2.2
      7289: Fix for AWC-1542 where utf-8 characters not displaying correctly in RSS feed output
      7300: Bumped up session size management values to reduce potential issues with mix-style, shorter transactions.
      7303: Portlet updates for MSIE problems in Liferay.
      7304: Added the <cifs-url-suffix>. AWC-1671.
      7317: Fix OO shutdown
      7319: Catch for raising rule executions using null NodeRefs.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7374 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-11-13 03:19:12 +00:00
parent dd06e3166b
commit 306e626cec
14 changed files with 313 additions and 119 deletions

View File

@@ -56,11 +56,12 @@ import org.apache.commons.logging.LogFactory;
public class PatchServiceImpl implements PatchService
{
private static final String MSG_NOT_RELEVANT = "patch.service.not_relevant";
private static final String MSG_APPLYING_PATCH = "patch.service.applying_patch";
private static final Date ZERO_DATE = new Date(0L);
private static final Date INFINITE_DATE = new Date(Long.MAX_VALUE);
private static Log logger = LogFactory.getLog(PatchServiceImpl.class);
private static Log logger = LogFactory.getLog(PatchExecuter.class);
private DescriptorService descriptorService;
private TransactionService transactionService;
@@ -226,15 +227,35 @@ public class PatchServiceImpl implements PatchService
// get the patch from the DAO
AppliedPatch appliedPatch = patchDaoService.getAppliedPatch(patch.getId());
// We bypass the patch if it was executed successfully
if (appliedPatch != null && appliedPatch.getWasExecuted() && appliedPatch.getSucceeded())
if (appliedPatch != null)
{
// it has already been applied
if (logger.isDebugEnabled())
if (appliedPatch.getWasExecuted() && appliedPatch.getSucceeded())
{
logger.debug("Patch was already successfully applied: \n" +
" patch: " + appliedPatch);
// It has already been successfully applied
if (logger.isDebugEnabled())
{
logger.debug("Patch was already successfully applied: \n" +
" patch: " + appliedPatch);
}
return appliedPatch;
}
else if (patch.getTargetSchema() != appliedPatch.getTargetSchema())
{
// The target schema of the defined patch has changed.
// The patch applicability was changed for some reason, usually as a result of
// merges between branches. We need to detect new patches in clean installs.
if (appliedPatch.getAppliedToSchema() == appliedPatch.getTargetSchema())
{
// The patch applicability changed, but it was originally not executed because
// it was a new patch in a clean install
if (logger.isDebugEnabled())
{
logger.debug("Patch not applied to a previously clean install: \n" +
" patch: " + appliedPatch);
}
return appliedPatch;
}
}
return appliedPatch;
}
// the execution report
String report = null;
@@ -253,6 +274,7 @@ public class PatchServiceImpl implements PatchService
// perform actual execution
try
{
logger.info(I18NUtil.getMessage(MSG_APPLYING_PATCH, patch.getId(), patch.getDescription()));
report = patch.apply();
success = true;
}