mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V2.1 to HEAD
6418: Allow getLayeringInfo on deleted nodes. 6419: fixes for submitting of deleted directories and regenerate renditions related fixes. 6420: Added installs to build 6421: Build fix for sdk 6423: WCM-710 - Submit All feature reintroducted to WCM My Modified Files views 6424: OpenOffice connection is now tested on bootstrap. 6425: AWC-1446 - Space Selector would show spaces you do not have access to 6426: WCM-699 - Staging area user assets 6427: Rollback exceptions now explicitly handled by RetryingTransactionHelper to extract the cause of the exception. 6428: Fix for AWC-1340 6429: Fixed transaction boundaries for full index recovery components 6433: AR-1660 - SMB and SMB2 signature check git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6732 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1616,7 +1616,7 @@ public class AVMRepository
|
||||
{
|
||||
throw new AVMNotFoundException("Store not found.");
|
||||
}
|
||||
Lookup lookup = store.lookup(version, pathParts[1], false, false);
|
||||
Lookup lookup = store.lookup(version, pathParts[1], false, true);
|
||||
if (lookup == null)
|
||||
{
|
||||
throw new AVMNotFoundException("Path not found.");
|
||||
|
@@ -101,6 +101,34 @@ import org.alfresco.util.Pair;
|
||||
*/
|
||||
public class AVMServiceTest extends AVMServiceTestBase
|
||||
{
|
||||
public void testHeadPathsInLayers()
|
||||
{
|
||||
try
|
||||
{
|
||||
setupBasicTree();
|
||||
fService.createStore("user");
|
||||
fService.createLayeredDirectory("main:/a", "user:/", "a");
|
||||
fService.createStore("sandbox");
|
||||
fService.createLayeredDirectory("main:/a", "sandbox:/", "a");
|
||||
fService.createDirectory("user:/a/b", "newdir");
|
||||
fService.createFile("user:/a/b/newdir", "bibble.txt").close();
|
||||
List<AVMDifference> diffs = fSyncService.compare(-1, "user:/a", -1, "sandbox:/a", null);
|
||||
System.out.println(diffs);
|
||||
fSyncService.update(diffs, null, false, false, false, false, null, null);
|
||||
AVMNodeDescriptor dir = fService.lookup(-1, "user:/a/b/newdir");
|
||||
List<Pair<Integer, String>> paths = fService.getHeadPaths(dir);
|
||||
System.out.println(paths);
|
||||
AVMNodeDescriptor file = fService.lookup(-1, "user:/a/b/newdir/bibble.txt");
|
||||
paths = fService.getHeadPaths(file);
|
||||
System.out.println(paths);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
fail();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Minimal testing of Locking Aware service.
|
||||
*/
|
||||
|
@@ -154,17 +154,28 @@ public class AVMSubmitPackageHandler
|
||||
private void recursivelyRemoveLocks(final String webProject, final int version, final String path)
|
||||
{
|
||||
LOGGER.debug("removing lock on " + path);
|
||||
final AVMNodeDescriptor desc = fAVMService.lookup(version, path, true);
|
||||
AVMNodeDescriptor desc = fAVMService.lookup(version, path, true);
|
||||
if (desc.isFile() || desc.isDeletedFile())
|
||||
{
|
||||
fAVMLockingService.removeLock(webProject, path.substring(path.indexOf(":") + 1));
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
for (final AVMNodeDescriptor child : fAVMService.getDirectoryListingArray(version, path, true))
|
||||
{
|
||||
this.recursivelyRemoveLocks(webProject, version, child.getPath());
|
||||
}
|
||||
if (desc.isDeletedDirectory())
|
||||
{
|
||||
// lookup the previous child and get its contents
|
||||
final List<AVMNodeDescriptor> history = fAVMService.getHistory(desc, 2);
|
||||
if (history.size() == 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
desc = history.get(1);
|
||||
}
|
||||
|
||||
for (final AVMNodeDescriptor child : fAVMService.getDirectoryListingArray(desc.getVersionID(), desc.getPath(), true))
|
||||
{
|
||||
this.recursivelyRemoveLocks(webProject, child.getVersionID(), child.getPath());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -210,7 +210,7 @@ public class AVMFullIndexRecoveryComponent extends AbstractReindexComponent
|
||||
return null;
|
||||
}
|
||||
};
|
||||
transactionService.getRetryingTransactionHelper().doInTransaction(reindexWork, true);
|
||||
transactionService.getRetryingTransactionHelper().doInTransaction(reindexWork, true, true);
|
||||
// done
|
||||
}
|
||||
|
||||
|
@@ -277,7 +277,7 @@ public class FullIndexRecoveryComponent extends AbstractReindexComponent
|
||||
return null;
|
||||
}
|
||||
};
|
||||
transactionService.getRetryingTransactionHelper().doInTransaction(reindexWork, true);
|
||||
transactionService.getRetryingTransactionHelper().doInTransaction(reindexWork, true, true);
|
||||
// done
|
||||
}
|
||||
}
|
@@ -27,6 +27,7 @@ package org.alfresco.repo.transaction;
|
||||
import java.sql.BatchUpdateException;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.transaction.RollbackException;
|
||||
import javax.transaction.Status;
|
||||
import javax.transaction.SystemException;
|
||||
import javax.transaction.UserTransaction;
|
||||
@@ -297,8 +298,16 @@ public class RetryingTransactionHelper
|
||||
throw new AlfrescoRuntimeException("Failure during rollback: " + cb, e1);
|
||||
}
|
||||
}
|
||||
lastException = (e instanceof RuntimeException) ?
|
||||
(RuntimeException)e : new AlfrescoRuntimeException("Unknown Exception in Transaction.", e);
|
||||
if (e instanceof RollbackException)
|
||||
{
|
||||
lastException = (e.getCause() instanceof RuntimeException) ?
|
||||
(RuntimeException)e.getCause() : new AlfrescoRuntimeException("Exception in Transaction.", e.getCause());
|
||||
}
|
||||
else
|
||||
{
|
||||
lastException = (e instanceof RuntimeException) ?
|
||||
(RuntimeException)e : new AlfrescoRuntimeException("Exception in Transaction.", e);
|
||||
}
|
||||
// Check if there is a cause for retrying
|
||||
Throwable retryCause = extractRetryCause(e);
|
||||
if (retryCause != null)
|
||||
|
Reference in New Issue
Block a user