lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehatc...@apache.org
Subject svn commit: r800273 - in /lucene/solr/trunk/contrib/dataimporthandler: CHANGES.txt src/main/java/org/apache/solr/handler/dataimport/XPathEntityProcessor.java
Date Mon, 03 Aug 2009 09:54:46 GMT
Author: ehatcher
Date: Mon Aug  3 09:54:46 2009
New Revision: 800273

URL: http://svn.apache.org/viewvc?rev=800273&view=rev
Log:
SOLR-1323: Reset XPathEntityProcessor's / when fetching next URL

Modified:
    lucene/solr/trunk/contrib/dataimporthandler/CHANGES.txt
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/XPathEntityProcessor.java

Modified: lucene/solr/trunk/contrib/dataimporthandler/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/CHANGES.txt?rev=800273&r1=800272&r2=800273&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/CHANGES.txt (original)
+++ lucene/solr/trunk/contrib/dataimporthandler/CHANGES.txt Mon Aug  3 09:54:46 2009
@@ -251,6 +251,8 @@
               
 28.SOLR-1286: Fix the commit parameter always defaulting to "true" even if "false" is explicitly
passed in.
               (Jay Hill, Noble Paul via ehatcher)
+            
+29.SOLR-1323: Reset XPathEntityProcessor's $hasMore/$nextUrl when fetching next URL (noble,
ehatcher)
              
 
 Documentation

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/XPathEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/XPathEntityProcessor.java?rev=800273&r1=800272&r2=800273&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/XPathEntityProcessor.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/XPathEntityProcessor.java
Mon Aug  3 09:54:46 2009
@@ -186,17 +186,22 @@
       r = getNext();
       if (r == null) {
         Object hasMore = context.getSessionAttribute(HAS_MORE, Context.SCOPE_ENTITY);
-        if ("true".equals(hasMore) || Boolean.TRUE.equals(hasMore)) {
-          String url = (String) context.getSessionAttribute(NEXT_URL, Context.SCOPE_ENTITY);
-          if (url == null)
-            url = context.getEntityAttribute(URL);
-          addNamespace();
-          initQuery(resolver.replaceTokens(url));
-          r = getNext();
-          if (r == null)
+        try {
+          if ("true".equals(hasMore) || Boolean.TRUE.equals(hasMore)) {
+            String url = (String) context.getSessionAttribute(NEXT_URL, Context.SCOPE_ENTITY);
+            if (url == null)
+              url = context.getEntityAttribute(URL);
+            addNamespace();
+            initQuery(resolver.replaceTokens(url));
+            r = getNext();
+            if (r == null)
+              return null;
+          } else {
             return null;
-        } else {
-          return null;
+          }
+        } finally {
+          context.setSessionAttribute(HAS_MORE,null,Context.SCOPE_ENTITY);
+          context.setSessionAttribute(NEXT_URL,null,Context.SCOPE_ENTITY);
         }
       }
       addCommonFields(r);



Mime
View raw message