This is an automated email from the git hooks/post-receive script. New commit to branch feature/7017 in repository observe. See http://git.codelutin.com/observe.git commit 731d1aba7422e475f71f0b1a325300a27eacb815 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Apr 27 15:38:55 2015 +0200 amélioration des erreurs sur le proxy (refs #7017) --- .../ird/observe/services/ObserveServiceFactory.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/observe-services/src/main/java/fr/ird/observe/services/ObserveServiceFactory.java b/observe-services/src/main/java/fr/ird/observe/services/ObserveServiceFactory.java index 74bbd77..79f76ef 100644 --- a/observe-services/src/main/java/fr/ird/observe/services/ObserveServiceFactory.java +++ b/observe-services/src/main/java/fr/ird/observe/services/ObserveServiceFactory.java @@ -8,7 +8,6 @@ import com.google.common.collect.Sets; import fr.ird.observe.ObserveApplicationContext; import fr.ird.observe.ObserveTechnicalException; import fr.ird.observe.db.DataSource; -import fr.ird.observe.db.DataSourceException; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.reflect.ConstructorUtils; import org.apache.commons.logging.Log; @@ -181,9 +180,9 @@ public class ObserveServiceFactory implements Closeable { Object result; - if (methodNamesToByPass.contains(method.getName()) || !method.isAnnotationPresent(NoTransaction.class)) { + if (methodNamesToByPass.contains(method.getName()) || method.isAnnotationPresent(NoTransaction.class)) { - result = method.invoke(target, args); + result = invokeMethod(method, args); } else { @@ -195,7 +194,17 @@ public class ObserveServiceFactory implements Closeable { } - protected Object invokeMethodWithTransaction(Method method, Object... args) throws DataSourceException, IllegalAccessException, InvocationTargetException { + protected Object invokeMethod(Method method, Object... args) throws Throwable { + try { + Object result = method.invoke(target, args); + return result; + } catch (InvocationTargetException e) { + throw e.getCause(); + } + } + + + protected Object invokeMethodWithTransaction(Method method, Object... args) throws Throwable { String methodName = method.getName(); @@ -207,7 +216,7 @@ public class ObserveServiceFactory implements Closeable { serviceContext.setTransaction(tx); - Object invoke = method.invoke(target, args); + Object invoke = invokeMethod(method, args); if (method.isAnnotationPresent(Commit.class)) { -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.