Skip to content
Snippets Groups Projects
Commit d6794547 authored by felmer's avatar felmer
Browse files

SP-481, BIS-317: log stack traces in warning logs. Improve log message

SVN: 28595
parent dd2da8ff
No related branches found
No related tags found
No related merge requests found
...@@ -94,12 +94,11 @@ public class OptimisticLockingRetryAdvisor extends DefaultPointcutAdvisor ...@@ -94,12 +94,11 @@ public class OptimisticLockingRetryAdvisor extends DefaultPointcutAdvisor
{ {
throw ex; throw ex;
} }
boolean giveUp = i < NUMBER_OF_TRIES - 1; boolean retry = i < NUMBER_OF_TRIES - 1;
operationLog.warn((giveUp ? "" : "Giving up after the ") + (i + 1) if (retry)
+ ". failed invocation of " + invocation.getMethod() + ". Reason: "
+ ex);
if (giveUp == false)
{ {
operationLog.warn("Retry after the " + (i + 1) + ". failed invocation of "
+ invocation.getMethod() + ". Reason: " + ex, ex);
try try
{ {
Thread.sleep((int) (Math.random() * MAX_WAITING_TIME_FOR_RETRY)); Thread.sleep((int) (Math.random() * MAX_WAITING_TIME_FOR_RETRY));
...@@ -107,6 +106,10 @@ public class OptimisticLockingRetryAdvisor extends DefaultPointcutAdvisor ...@@ -107,6 +106,10 @@ public class OptimisticLockingRetryAdvisor extends DefaultPointcutAdvisor
{ {
// Ignored // Ignored
} }
} else
{
operationLog.error("Giving up after " + (i + 1) + ". failed invocation of "
+ invocation.getMethod() + ". Reason: " + ex);
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment