Skip to content
Snippets Groups Projects
Commit 2452550e authored by cramakri's avatar cramakri
Browse files

BIS-317 SP-481 : Retry optimistic locking failures on the GUI API.

SVN: 28532
parent 53dafce1
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@ import org.apache.log4j.Logger;
import org.springframework.aop.ClassFilter;
import org.springframework.aop.MethodMatcher;
import org.springframework.aop.Pointcut;
import org.springframework.aop.framework.ReflectiveMethodInvocation;
import org.springframework.aop.support.DefaultPointcutAdvisor;
import org.springframework.aop.support.RootClassFilter;
import org.springframework.core.Ordered;
......@@ -81,7 +82,13 @@ public class OptimisticLockingRetryAdvisor extends DefaultPointcutAdvisor
{
// System.out.println("try " + (i + 1) + ". time: "
// + invocation.getMethod().getName() + "@" + invocation.getThis());
return invocation.proceed();
if (invocation instanceof ReflectiveMethodInvocation)
{
return ((ReflectiveMethodInvocation) invocation).invocableClone().proceed();
} else
{
return invocation.proceed();
}
} catch (Exception ex)
{
latestException = ex;
......
......@@ -308,6 +308,11 @@
<bean class="ch.systemsx.cisd.openbis.common.spring.LogAdvisor" />
<bean class="ch.systemsx.cisd.openbis.common.spring.MarkerLogApplicationListener"/>
<!--
// Optimistic Lock Failure Retrying
-->
<bean class="ch.systemsx.cisd.openbis.generic.server.OptimisticLockingRetryAdvisor" />
<!--
......
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