jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1378617 - /jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_REST.java
Date Wed, 29 Aug 2012 15:39:55 GMT
Author: andy
Date: Wed Aug 29 15:39:54 2012
New Revision: 1378617

URL: http://svn.apache.org/viewvc?rev=1378617&view=rev
Log:
Fix (delay finding the dataset until inside a transaction in case dynamic datasets applies.)

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

Modified: jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_REST.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_REST.java?rev=1378617&r1=1378616&r2=1378617&view=diff
==============================================================================
--- jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_REST.java
(original)
+++ jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_REST.java
Wed Aug 29 15:39:54 2012
@@ -74,11 +74,10 @@ public abstract class SPARQL_REST extend
             _target = Target.createNamed(desc.dataset, absUri, gn) ; 
         }
         
-        private final Target _target ; 
+        private Target _target = null ; 
         protected HttpActionREST(long id, DatasetRef desc, HttpServletRequest request, HttpServletResponse
response, boolean verbose)
         {
             super(id, desc, request, response, verbose) ;
-            _target = targetGraph(request, desc, super.getActiveDSG() ) ;
         }
 
         protected final boolean hasTarget()
@@ -90,6 +89,13 @@ public abstract class SPARQL_REST extend
         
         protected final Target getTarget() 
         {
+            // Delayed until inside a transaction.
+            if ( _target == null )
+            {
+                if ( super.getActiveDSG() == null )
+                    errorOccurred("Internal error : No action graph (not in a transaction?)")
;
+                _target = targetGraph(request, super.getDatasetRef(), super.getActiveDSG()
) ;
+            }
             return _target ;
         }
     }
@@ -391,7 +397,9 @@ public abstract class SPARQL_REST extend
         {
             // Direct naming or error.
             uri = request.getRequestURL().toString() ;
-            //errorBadRequest("Neither default graph nor named graph specificed") ;
+            if ( request.getRequestURI().equals(desc.name) )
+                // No name 
+                errorBadRequest("Neither default graph nor named graph specificed; no direct
name") ;
         }
         
         if ( dftGraph )



Mime
View raw message