ETHREEOH-2873 - could we log the value of clearAllChildren?

- debug logging added

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@17077 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2009-10-22 09:12:03 +00:00
parent 837608d8f3
commit dc1440a869

View File

@@ -149,12 +149,22 @@ public class ExportSourceImporter implements ImporterJobSPI
AuthenticationUtil.setRunAsUserSystem(); AuthenticationUtil.setRunAsUserSystem();
if (clearAllChildren) if (clearAllChildren)
{ {
logger.debug("clear all children");
List<NodeRef> refs = searchService.selectNodes(nodeService.getRootNode(storeRef), path, null, List<NodeRef> refs = searchService.selectNodes(nodeService.getRootNode(storeRef), path, null,
namespacePrefixResolver, false); namespacePrefixResolver, false);
for (NodeRef ref : refs) for (NodeRef ref : refs)
{ {
if(logger.isDebugEnabled())
{
logger.debug("clear node ref" + ref);
}
for (ChildAssociationRef car : nodeService.getChildAssocs(ref)) for (ChildAssociationRef car : nodeService.getChildAssocs(ref))
{ {
if(logger.isDebugEnabled())
{
logger.debug("delete child" + car.getChildRef());
}
nodeService.deleteNode(car.getChildRef()); nodeService.deleteNode(car.getChildRef());
} }
} }
@@ -162,6 +172,7 @@ public class ExportSourceImporter implements ImporterJobSPI
if (caches != null) if (caches != null)
{ {
logger.debug("clearing caches");
for (SimpleCache cache : caches) for (SimpleCache cache : caches)
{ {
@@ -190,7 +201,7 @@ public class ExportSourceImporter implements ImporterJobSPI
cache.clear(); cache.clear();
} }
} }
logger.debug("about to commit");
userTransaction.commit(); userTransaction.commit();
} }
catch (Throwable t) catch (Throwable t)
@@ -199,11 +210,13 @@ public class ExportSourceImporter implements ImporterJobSPI
{ {
if (userTransaction != null) if (userTransaction != null)
{ {
logger.debug("rolling back due to exception", t);
userTransaction.rollback(); userTransaction.rollback();
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
logger.debug("exception during rollback", ex);
} }
throw new ExportSourceImporterException("Failed to import", t); throw new ExportSourceImporterException("Failed to import", t);
} }