summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordeva <deva>2011-06-10 06:38:09 +0000
committerdeva <deva>2011-06-10 06:38:09 +0000
commita949a28ef255983bf1b3b52eb90f1859240a897b (patch)
tree242e0ce5181be59b6fd154ae1c3b1d1e2b6acf18
parent9cafd5b42d73945841a779c3c62d1e784ea95fb3 (diff)
Disable timeouts of resumes created in current session.
-rw-r--r--server/src/pracrodaopgsql.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/server/src/pracrodaopgsql.cc b/server/src/pracrodaopgsql.cc
index d3ae8df..774fb0c 100644
--- a/server/src/pracrodaopgsql.cc
+++ b/server/src/pracrodaopgsql.cc
@@ -278,9 +278,10 @@ Values PracroDAOPgsql::getLatestValues(std::string sessionid,
" (SELECT f.name, MAX(t.timestamp) AS ts "
" FROM commits c, fields f, transactions t "
" WHERE ";
- if(!uncom) query += "(c.status='committed' OR c.uid="+sessionid+") AND ";
+ //if(!uncom) query += "(c.status='committed' OR c.uid="+sessionid+") AND ";
+ if(!uncom) query += "((c.status='committed' AND t.timestamp >= " + soldest.str() + ") OR c.uid="+sessionid+") AND ";
query += "c.uid = t.cid AND t.uid = f.transaction"
- " AND t.timestamp >= " + soldest.str() +
+ // " AND t.timestamp >= " + soldest.str() +
" AND c.patientid = '" + W.esc(patientid) + "' "
+ namecond;
if(macro) {
@@ -341,9 +342,10 @@ unsigned PracroDAOPgsql::nrOfCommits(std::string sessionid,
pqxx::work W(*conn);
query = "SELECT count(*) FROM commits c, transactions f"
" WHERE c.patientid = '" + W.esc(patientid) + "' AND c.uid = f.cid";
- if(!uncom) query += " AND (c.status='committed' OR c.uid="+sessionid+")";
+ //if(!uncom) query += " AND (c.status='committed' OR c.uid="+sessionid+")";
+ if(!uncom) query += " AND ((c.status='committed' AND f.timestamp >= " + soldest.str() + ") OR c.uid="+sessionid+")";
query += " AND f.macro = '" + W.esc(macroname) + "' "
- " AND f.timestamp >= " + soldest.str()
+ //" AND f.timestamp >= " + soldest.str()
;
DEBUG(sql, "Query: %s\n", query.c_str());
pqxx::result R = W.exec(query);