From e40d084d8f206bea79ff291ba9176b74d7d9ca1c Mon Sep 17 00:00:00 2001
From: felmer <felmer>
Date: Tue, 12 Mar 2013 10:40:18 +0000
Subject: [PATCH] SP-481, BIS-317: ensure that OptimisticLockingRetryAdvisor is
 after LogAdvisor.

SVN: 28596
---
 .../ch/systemsx/cisd/openbis/common/spring/LogAdvisor.java    | 3 ++-
 .../openbis/generic/server/OptimisticLockingRetryAdvisor.java | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/openbis-common/source/java/ch/systemsx/cisd/openbis/common/spring/LogAdvisor.java b/openbis-common/source/java/ch/systemsx/cisd/openbis/common/spring/LogAdvisor.java
index a21ef75f586..17fc133bfe8 100644
--- a/openbis-common/source/java/ch/systemsx/cisd/openbis/common/spring/LogAdvisor.java
+++ b/openbis-common/source/java/ch/systemsx/cisd/openbis/common/spring/LogAdvisor.java
@@ -32,11 +32,12 @@ public class LogAdvisor extends DefaultPointcutAdvisor
 {
 
     private static final long serialVersionUID = 1L;
+    public static final int ORDER = Ordered.HIGHEST_PRECEDENCE;
 
     LogAdvisor()
     {
         super(createPointcut(), createAdvice());
-        setOrder(Ordered.HIGHEST_PRECEDENCE);
+        setOrder(ORDER);
     }
 
     private final static Advice createAdvice()
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/OptimisticLockingRetryAdvisor.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/OptimisticLockingRetryAdvisor.java
index 96a49251a7e..7f9d3cdbe8a 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/OptimisticLockingRetryAdvisor.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/OptimisticLockingRetryAdvisor.java
@@ -25,13 +25,13 @@ 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;
 import org.springframework.dao.DeadlockLoserDataAccessException;
 import org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException;
 
 import ch.systemsx.cisd.common.exceptions.ExceptionUtils;
 import ch.systemsx.cisd.common.logging.LogCategory;
 import ch.systemsx.cisd.common.logging.LogFactory;
+import ch.systemsx.cisd.openbis.common.spring.LogAdvisor;
 import ch.systemsx.cisd.openbis.generic.shared.IServer;
 
 /**
@@ -48,7 +48,7 @@ public class OptimisticLockingRetryAdvisor extends DefaultPointcutAdvisor
     public OptimisticLockingRetryAdvisor()
     {
         super(new AllServerMethodsPointcut(), new RetryInterceptor());
-        setOrder(Ordered.HIGHEST_PRECEDENCE);
+        setOrder(LogAdvisor.ORDER + 1);
     }
 
     private static class AllServerMethodsPointcut implements Pointcut
-- 
GitLab