Merged 5.1.N (5.1.1) to HEAD (5.2)

122470 dhulley: Request failure details from SQL execution in method 'PropertyValueDAOImpl.cleanupUnusedValues()' (ACE-5143)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@123664 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-03-11 22:26:23 +00:00
parent 66c532ceb6
commit 0035333246

View File

@@ -699,24 +699,35 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
public void cleanupUnusedValues() public void cleanupUnusedValues()
{ {
// execute clean up in case of previous failures // execute clean up in case of previous failures
scriptExecutor.exec("alfresco/dbscripts/utility/${db.script.dialect}", "CleanAlfPropTablesPostExec.sql");
try try
{ {
scriptExecutor.exec("alfresco/dbscripts/utility/${db.script.dialect}", "CleanAlfPropTables.sql"); scriptExecutor.exec("alfresco/dbscripts/utility/${db.script.dialect}", "CleanAlfPropTablesPostExec.sql");
}
catch (RuntimeException e)
{
logger.error("The pre-exec cleanup script failed: ", e);
}
// Run the main script
try
{
scriptExecutor.exec(false, "alfresco/dbscripts/utility/${db.script.dialect}", "CleanAlfPropTables.sql");
}
catch (RuntimeException e)
{
logger.error("The cleanup script failed: ", e);
throw e;
} }
finally finally
{ {
try try
{ {
// execute clean up // execute clean up
scriptExecutor.exec("alfresco/dbscripts/utility/${db.script.dialect}", "CleanAlfPropTablesPostExec.sql"); scriptExecutor.exec(false, "alfresco/dbscripts/utility/${db.script.dialect}", "CleanAlfPropTablesPostExec.sql");
} }
catch (Exception e) catch (RuntimeException e)
{ {
if (logger.isErrorEnabled()) logger.error("The post-exec cleanup script failed: ", e);
{ // We do not rethrow this as we want to preserve the original failure
logger.error("The cleanup failed with an error: ", e);
}
} }
clearCaches(); clearCaches();
} }