Update of /cvsroot/monetdb/pathfinder/runtime
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20076/runtime

Modified Files:
        pathfinder.mx 
Log Message:
propagated changes of Thursday Oct 08 2009
from the Nov2009 branch to the development trunk

  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2009/10/08 - sjoerd: runtime/pathfinder.mx,1.462.4.3
  propagated changes of Thursday Oct 08 2009
  from the Aug2009_NFI branch to the Nov2009 branch
  
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2009/10/08 - boncz: runtime/pathfinder.mx,1.462.6.5
    - improve concurrency control for sessions; abort queries that get a 
user-aborted session
    - make updates terminate sessions better)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2009/10/08 - boncz: runtime/pathfinder.mx,1.462.6.6
    *** empty log message ***
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2009/10/08 - boncz: runtime/pathfinder.mx,1.462.6.7
    - fix in session mgmt
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


U pathfinder.mx
Index: pathfinder.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/pathfinder.mx,v
retrieving revision 1.465
retrieving revision 1.466
diff -u -d -r1.465 -r1.466
--- pathfinder.mx       7 Oct 2009 16:55:58 -0000       1.465
+++ pathfinder.mx       8 Oct 2009 11:21:47 -0000       1.466
@@ -551,7 +551,7 @@
 PROC _ws_xrpc_end(str xrpc_qid, str errmsg) : void
 {
     var idx := reverse(xrpc_qids).find(xrpc_qid);
-    if (isnil(errmsg)) { 
+    if (isnil(errmsg) and (xrpc_timeout > 0LL)) { 
         xrpc_statuses.inplace(idx, "wait");
     } else {
         xrpc_statuses.inplace(idx, "abort");
@@ -1529,10 +1529,7 @@
             var timeout := 0LL; 
             if (bit(xrpc_timeout)) timeout := usec() + *(1000LL, xrpc_timeout);
             xrpc_timeouts.inplace(idx, timeout);
-        }
-        if (xrpc_mode != "use-cache-repeatable") {
-            xrpc_statuses.inplace(idx, "exec");
-            return ws;
+            xrpc_statuses.inplace(idx, "reserved");
         }
         ws := [access]([copy](ws),BAT_WRITE); # use a copy, no locking required
     } else {
@@ -1543,7 +1540,7 @@
             xrpc_timeouts.append(usec() + *(1000LL, xrpc_timeout));
             xrpc_wsbats.append(ws);
             xrpc_locks.append(wslock);
-            xrpc_statuses.append("exec");
+            xrpc_statuses.append("reserved");
             xrpc_mode := "cache-repeatable";
         }
     }
@@ -1573,7 +1570,9 @@
 PROC ws_create(int update) : BAT[void,bat]
 {
     if (bit(and(update,2)) and (xrpc_mode.search("cache") >= 0)) {
-        ERROR("ws_create: update queries should not be done in a cached 
session");
+        # updates in a session terminate the session
+        xrpc_timeout := 0;
+        xrpc_mode := "cache-repeatable";
     }
 
     # NOTE: use pre-query MIL variables xrpc_qid/xrpc_timeout to possibly 
re-use an existing ws
@@ -1586,7 +1585,17 @@
     # each xrpc request must lock its ws; read-only use directly unlocks again
     if (not(isnil(wslock))) {
         lock_set(wslock);
-        if (xrpc_mode = "use-cache-repeatable") lock_unset(wslock);
+
+        lock_set(xrpc_lock);
+        var aborted := (xrpc_statuses.find(idx) = "abort");
+        if ((xrpc_mode = "use-cache-repeatable") or aborted) {
+            lock_unset(wslock);
+            if (not(aborted)) xrpc_statuses.inplace(idx, "wait");
+        } else {
+            xrpc_statuses.inplace(idx, "exec");
+        }
+        lock_unset(xrpc_lock);
+        if (aborted) ERROR("ws_create: session was aborted by a previous 
query"); 
     }
     if (xrpc > 0) return ws;
 


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to