Index: lams_common/src/java/org/lamsfoundation/lams/web/filter/TransactionRetryInterceptor.java =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r80befea7836aebb10f448ff3ad8c8f3a4522725a --- lams_common/src/java/org/lamsfoundation/lams/web/filter/TransactionRetryInterceptor.java (.../TransactionRetryInterceptor.java) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_common/src/java/org/lamsfoundation/lams/web/filter/TransactionRetryInterceptor.java (.../TransactionRetryInterceptor.java) (revision 80befea7836aebb10f448ff3ad8c8f3a4522725a) @@ -27,6 +27,7 @@ import org.aopalliance.intercept.MethodInvocation; import org.apache.commons.lang.mutable.MutableInt; import org.apache.log4j.Logger; +import org.hibernate.PessimisticLockException; import org.hibernate.exception.ConstraintViolationException; import org.hibernate.exception.LockAcquisitionException; import org.lamsfoundation.lams.util.ITransactionRetryService; @@ -69,24 +70,22 @@ exception = e; TransactionRetryInterceptor.log.error("Schema error", exception); processException(e, invocation, attempt); - } catch (CannotAcquireLockException e) { + } catch (CannotAcquireLockException | LockAcquisitionException | UnexpectedRollbackException + | PessimisticLockException e) { exception = e; processException(e, invocation, attempt); - } catch (LockAcquisitionException e) { - exception = e; - processException(e, invocation, attempt); - } catch (UnexpectedRollbackException e) { - exception = e; - processException(e, invocation, attempt); } } while (attempt.intValue() <= TransactionRetryInterceptor.MAX_ATTEMPTS); throw exception; } private void processException(Exception e, MethodInvocation invocation, MutableInt attempt) { - StringBuilder message = new StringBuilder("When invoking method \"").append(invocation.getMethod().getName()) - .append("\" caught \"").append(e.getMessage()).append("\". Attempt #").append(attempt); + StringBuilder message = new StringBuilder("When invoking method ") + .append(invocation.getMethod().getDeclaringClass().getName()).append("#") + .append(invocation.getMethod().getName()).append(" caught \"").append(e.getMessage()) + .append("\". Attempt #").append(attempt); + attempt.increment(); if (attempt.intValue() <= TransactionRetryInterceptor.MAX_ATTEMPTS) { message.append(". Retrying.");