mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Handle RolledbackException better (non-functional change)
Added conversion from Enum types to String git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2315 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -16,9 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.repo.transaction;
|
package org.alfresco.repo.transaction;
|
||||||
|
|
||||||
|
import javax.transaction.RollbackException;
|
||||||
import javax.transaction.Status;
|
import javax.transaction.Status;
|
||||||
import javax.transaction.UserTransaction;
|
import javax.transaction.UserTransaction;
|
||||||
|
|
||||||
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
import org.alfresco.service.transaction.TransactionService;
|
import org.alfresco.service.transaction.TransactionService;
|
||||||
import org.alfresco.util.ParameterCheck;
|
import org.alfresco.util.ParameterCheck;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
@@ -137,6 +139,13 @@ public class TransactionUtil
|
|||||||
txn.commit();
|
txn.commit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (RollbackException exception)
|
||||||
|
{
|
||||||
|
// commit failed
|
||||||
|
throw new AlfrescoRuntimeException(
|
||||||
|
"Unexpected rollback of exception: \n" + exception.getMessage(),
|
||||||
|
exception);
|
||||||
|
}
|
||||||
catch (Throwable exception)
|
catch (Throwable exception)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@@ -235,6 +235,19 @@ public class DefaultTypeConverter
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// From enum
|
||||||
|
//
|
||||||
|
|
||||||
|
INSTANCE.addConverter(Enum.class, String.class, new TypeConverter.Converter<Enum, String>()
|
||||||
|
{
|
||||||
|
public String convert(Enum source)
|
||||||
|
{
|
||||||
|
return source.toString();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Number to Subtypes and Date
|
// Number to Subtypes and Date
|
||||||
//
|
//
|
||||||
|
Reference in New Issue
Block a user