You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2013/04/17 22:07:17 UTC

svn commit: r1469052 - /jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Query.java

Author: andy
Date: Wed Apr 17 20:07:17 2013
New Revision: 1469052

URL: http://svn.apache.org/r1469052
Log:
Comments about timeouts

Modified:
    jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Query.java

Modified: jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Query.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Query.java?rev=1469052&r1=1469051&r2=1469052&view=diff
==============================================================================
--- jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Query.java (original)
+++ jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Query.java Wed Apr 17 20:07:17 2013
@@ -259,7 +259,7 @@ public abstract class SPARQL_Query exten
             action.endRead() ; }
     }
 
-    /** Check the query - throw ActionErrorException or call super.error* */
+    /** Check the query - if unacceptable, throw ActionErrorException or call super.error */
     protected abstract void validateQuery(HttpActionQuery action, Query query) ;
 
     protected QueryExecution createQueryExecution(Query query, Dataset dataset)
@@ -276,13 +276,21 @@ public abstract class SPARQL_Query exten
             ResultSet rs = qExec.execSelect() ;
             
             // Force some query execution now.
-            // Do this to force the query to do something that should touch any underlying database,
+            //
+            // If the timeout-first-row goes off, the output stream has not 
+            // been started so the HTTP error code is sent. 
+            //
+            // This also forces the query to do something that should touch any underlying database,
             // and hence ensure the communications layer is working.
             // MySQL can time out after 8 hours of an idle connection
+            
             rs.hasNext() ;
 
-            // Not necessary if we are inside a read transaction or lock until the end of sending results. 
-            // rs = ResultSetFactory.copyResults(rs) ;
+            // If we wanted perfect query time cancellation, we could consume the result now
+            // to see if the timeout-end-of-query goes off.  
+            // Not necessary if we are inside a read transaction or lock until the end of sending results.
+            
+            //rs = ResultSetFactory.copyResults(rs) ;
 
             log.info(format("[%d] exec/select", action.id)) ;
             return new SPARQLResult(rs) ;