geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasonhu...@apache.org
Subject [1/3] geode git commit: Added catch when executing from client without singlehop
Date Tue, 18 Apr 2017 16:22:32 GMT
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-2703 9a93b7acd -> 1bd2b86ee


Added catch when executing from client without singlehop


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/f408ccad
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/f408ccad
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/f408ccad

Branch: refs/heads/feature/GEODE-2703
Commit: f408ccad86418626009bf1d0b306b98a84c20b03
Parents: 9a93b7a
Author: Jason Huynh <huynhja@gmail.com>
Authored: Fri Apr 14 09:16:21 2017 -0700
Committer: Jason Huynh <huynhja@gmail.com>
Committed: Fri Apr 14 09:16:21 2017 -0700

----------------------------------------------------------------------
 .../org/apache/geode/cache/lucene/internal/LuceneQueryImpl.java  | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/f408ccad/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneQueryImpl.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneQueryImpl.java
b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneQueryImpl.java
index 26f3929..d660608 100644
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneQueryImpl.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneQueryImpl.java
@@ -119,11 +119,15 @@ public class LuceneQueryImpl<K, V> implements LuceneQuery<K,
V> {
     } catch (FunctionException e) {
       if (e.getCause() instanceof LuceneQueryException) {
         throw new LuceneQueryException(e);
+      } else if (e.getCause() instanceof TransactionException) {
+        //When run from client with single hop disabled
+        throw new LuceneQueryException(LUCENE_QUERY_CANNOT_BE_EXECUTED_WITHIN_A_TRANSACTION);
       } else if (e.getCause() instanceof RuntimeException) {
         throw (RuntimeException) e.getCause();
       }
       throw e;
     } catch (TransactionException e) {
+      //When function execution is run from server
       throw new LuceneQueryException(LUCENE_QUERY_CANNOT_BE_EXECUTED_WITHIN_A_TRANSACTION);
     }
 


Mime
View raw message