mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V2.1 to HEAD
6958: Fix for WCM-823 6959: Merged V1.4 to V2.1 6943: Upgrade scripts for transaction commit time and indexes for QName columns on alf_child_assoc 6960: Fixed script patch "applied on" date updates. 6961: Retry transactions on ConstraintViolationException. 6964: Added svn revision number to be substituted into build string if build number is not passed. 6965: Daylight savings for FTP. Fix for AR-1776. 6966: Added catch blocks for the AVMLockingException. WCM-877. 6967: Interim fix for WCM-866 (large link validation report causes SQL exception) 6968: Fixes for AWC-1309 "Broken preview image for Web Projects in MySpaces" and similar AWC-1635 "Broken/Missing images in MySpaces Web Script". 6970: Force DB write ordering of the NodeStatus vs Node object. 6971: More transaction demarcation fixes for special cases of non-executed script patches. 6972: Switch off session size management for the mass archive and restore test. 6973: Fixed AR-1801: Boolean isMultiValued() no longer returns null git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7370 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -80,4 +80,12 @@ public interface PatchDaoService
|
||||
* a date
|
||||
*/
|
||||
public List<AppliedPatch> getAppliedPatches(Date from, Date to);
|
||||
|
||||
/**
|
||||
* Update the patch <i>applied on</i> date.
|
||||
*
|
||||
* @param id the patch ID
|
||||
* @param appliedOnDate the date applied
|
||||
*/
|
||||
public void setAppliedOnDate(String id, Date appliedOnDate);
|
||||
}
|
||||
|
@@ -116,7 +116,7 @@ public class PatchServiceImpl implements PatchService
|
||||
// construct a list of executed patches by ID (also check the date)
|
||||
Map<String, AppliedPatch> appliedPatchesById = new HashMap<String, AppliedPatch>(23);
|
||||
List<AppliedPatch> appliedPatches = patchDaoService.getAppliedPatches();
|
||||
for (AppliedPatch appliedPatch : appliedPatches)
|
||||
for (final AppliedPatch appliedPatch : appliedPatches)
|
||||
{
|
||||
appliedPatchesById.put(appliedPatch.getId(), appliedPatch);
|
||||
// Update the time of execution if it is null. This is to deal with
|
||||
@@ -124,7 +124,16 @@ public class PatchServiceImpl implements PatchService
|
||||
// an execution time assigned
|
||||
if (appliedPatch.getAppliedOnDate() == null)
|
||||
{
|
||||
appliedPatch.setAppliedOnDate(new Date());
|
||||
RetryingTransactionCallback<Date> callback = new RetryingTransactionCallback<Date>()
|
||||
{
|
||||
public Date execute() throws Throwable
|
||||
{
|
||||
Date now = new Date();
|
||||
patchDaoService.setAppliedOnDate(appliedPatch.getId(), now);
|
||||
return now;
|
||||
}
|
||||
};
|
||||
transactionService.getRetryingTransactionHelper().doInTransaction(callback, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -128,4 +128,10 @@ public class HibernatePatchDaoServiceImpl extends HibernateDaoSupport implements
|
||||
// done
|
||||
return queryResults;
|
||||
}
|
||||
|
||||
public void setAppliedOnDate(String id, Date appliedOnDate)
|
||||
{
|
||||
AppliedPatch patch = (AppliedPatch) getHibernateTemplate().get(AppliedPatchImpl.class, id);
|
||||
patch.setAppliedOnDate(appliedOnDate);
|
||||
}
|
||||
}
|
||||
|
@@ -163,21 +163,13 @@ public class AVMSubmitPackageHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
if (desc.isDeletedDirectory())
|
||||
if (desc.isDeletedDirectory() == false)
|
||||
{
|
||||
// lookup the previous child and get its contents
|
||||
final List<AVMNodeDescriptor> history = fAVMService.getHistory(desc, 2);
|
||||
if (history.size() == 1)
|
||||
Map<String, AVMNodeDescriptor> list = fAVMService.getDirectoryListing(desc, true);
|
||||
for (AVMNodeDescriptor child : list.values())
|
||||
{
|
||||
return;
|
||||
recursivelyRemoveLocks(webProject, version, child.getPath());
|
||||
}
|
||||
desc = history.get(1);
|
||||
}
|
||||
|
||||
Map<String, AVMNodeDescriptor> list = fAVMService.getDirectoryListing(desc, true);
|
||||
for (AVMNodeDescriptor child : list.values())
|
||||
{
|
||||
recursivelyRemoveLocks(webProject, version, child.getPath());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -35,6 +35,7 @@ import javax.transaction.UserTransaction;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.domain.hibernate.SessionSizeResourceManager;
|
||||
import org.alfresco.repo.node.StoreArchiveMap;
|
||||
import org.alfresco.repo.node.archive.RestoreNodeReport.RestoreStatus;
|
||||
import org.alfresco.repo.node.integrity.IntegrityChecker;
|
||||
@@ -471,6 +472,8 @@ public class ArchiveAndRestoreTest extends TestCase
|
||||
*/
|
||||
public void testArchiveVsDeletePerformance() throws Exception
|
||||
{
|
||||
// Disable the in-transaction flushing
|
||||
SessionSizeResourceManager.setDisableInTransaction();
|
||||
// Start by deleting the node structure and then recreating it.
|
||||
// Only measure the delete speed
|
||||
int iterations = 100;
|
||||
|
@@ -40,6 +40,7 @@ import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.hibernate.StaleObjectStateException;
|
||||
import org.hibernate.StaleStateException;
|
||||
import org.hibernate.exception.ConstraintViolationException;
|
||||
import org.hibernate.exception.LockAcquisitionException;
|
||||
import org.springframework.dao.ConcurrencyFailureException;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
@@ -70,6 +71,7 @@ public class RetryingTransactionHelper
|
||||
StaleObjectStateException.class,
|
||||
LockAcquisitionException.class,
|
||||
BatchUpdateException.class,
|
||||
ConstraintViolationException.class,
|
||||
DataIntegrityViolationException.class,
|
||||
StaleStateException.class
|
||||
};
|
||||
|
Reference in New Issue
Block a user