Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)

93965: Merged DEV to HEAD-BUG-FIX
      93958: MNT-12770: Test failures on DB2
       - Try to recreate property value one more time if DuplicateKeyException occurs.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@95017 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-01-31 15:26:49 +00:00
parent dd5ef65a3c
commit e47fbe8681

View File

@@ -407,6 +407,20 @@ public class PropertyValueDAOImpl extends AbstractPropertyValueDAOImpl
@Override
protected PropertyValueEntity createPropertyValue(Serializable value)
{
try
{
return createPropertyValueInternal(value);
}
catch (DuplicateKeyException e )
{
//In very rare situation, it can fail. Just try one more time.
//See MNT-12770 for details
return createPropertyValueInternal(value);
}
}
private PropertyValueEntity createPropertyValueInternal(Serializable value)
{
// Get the actual type ID
Class<?> clazz = (value == null ? Object.class : value.getClass());