Update of /cvsroot/monetdb/pathfinder/runtime
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv10498/runtime
Modified Files:
Tag: Aug2009_NFI
pathfinder.mx
Log Message:
- improve concurrency control for sessions; abort queries that get a
user-aborted session
- make updates terminate sessions better)
U pathfinder.mx
Index: pathfinder.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/pathfinder.mx,v
retrieving revision 1.462.6.4
retrieving revision 1.462.6.5
diff -u -d -r1.462.6.4 -r1.462.6.5
--- pathfinder.mx 7 Oct 2009 16:27:47 -0000 1.462.6.4
+++ pathfinder.mx 8 Oct 2009 09:32:49 -0000 1.462.6.5
@@ -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");
@@ -1530,10 +1530,6 @@
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;
- }
ws := [access]([copy](ws),BAT_WRITE); # use a copy, no locking required
} else {
ws := [ws_new](mirror(ws_tpe), ws_tpe, ws_htp, ws_ttp, ws_seq);
@@ -1573,7 +1569,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 +1584,16 @@
# 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);
+ } 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