Author: michiel
Date: 2009-06-25 21:43:23 +0200 (Thu, 25 Jun 2009)
New Revision: 36429

Modified:
   
mmbase/trunk/core/src/main/java/org/mmbase/bridge/implementation/BasicCloud.java
   
mmbase/trunk/core/src/main/java/org/mmbase/bridge/implementation/BasicQuery.java
Log:
If queries are about to be used, they _must be_ made unmodifiable, It seems 
that this didn't always happen

Modified: 
mmbase/trunk/core/src/main/java/org/mmbase/bridge/implementation/BasicCloud.java
===================================================================
--- 
mmbase/trunk/core/src/main/java/org/mmbase/bridge/implementation/BasicCloud.java
    2009-06-25 18:32:26 UTC (rev 36428)
+++ 
mmbase/trunk/core/src/main/java/org/mmbase/bridge/implementation/BasicCloud.java
    2009-06-25 19:43:23 UTC (rev 36429)
@@ -634,6 +634,7 @@
     public NodeList getList(Query query) {
         log.debug("get List");
         NodeList result;
+        query.markUsed();
         if (query.isAggregating()) { // should this perhaps be a seperate 
method? --> Then also 'isAggregating' not needed any more
             result = getResultNodeList(query);
         } else {
@@ -671,9 +672,9 @@
             if (! checked) {
                 log.warn("Query " + query + " could not be completely modified 
by security: Aggregated result might be wrong");
             }
+            query.markUsed();
             ResultBuilder resultBuilder = new 
ResultBuilder(BasicCloudContext.mmb, query);
             List<MMObjectNode> resultList = resultBuilder.getResult();
-            query.markUsed();
             NodeManager tempNodeManager = new VirtualNodeManager(query, this);
             NodeList resultNodeList = new BasicNodeList(resultList, 
tempNodeManager);
             resultNodeList.setProperty(NodeList.QUERY_PROPERTY, query);
@@ -840,6 +841,7 @@
     protected NodeList getSecureList(Query query) {
 
         boolean checked = setSecurityConstraint(query);
+        query.markUsed();
 
         List<MMObjectNode> resultList = getClusterNodes(query);
 

Modified: 
mmbase/trunk/core/src/main/java/org/mmbase/bridge/implementation/BasicQuery.java
===================================================================
--- 
mmbase/trunk/core/src/main/java/org/mmbase/bridge/implementation/BasicQuery.java
    2009-06-25 18:32:26 UTC (rev 36428)
+++ 
mmbase/trunk/core/src/main/java/org/mmbase/bridge/implementation/BasicQuery.java
    2009-06-25 19:43:23 UTC (rev 36429)
@@ -624,6 +624,7 @@
 
     public boolean markUsed() {
         boolean wasUsed = used;
+        query.setModifiable(false);
         if (queryCheck == null) {  // if called manually
             /// XXXX CASTING HERE. Is this really necessary!
             // apply security constraints first, if not yet done, because the 
query gets unmodifiable from now on.

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to