summaryrefslogtreecommitdiff
path: root/server/src/database.h
diff options
context:
space:
mode:
authordeva <deva>2011-02-04 07:43:00 +0000
committerdeva <deva>2011-02-04 07:43:00 +0000
commitbfe5d3000182cb10db583fe42ffa7b48f84d8b5b (patch)
tree8b4228e258716267e854975df7f8a01294c89562 /server/src/database.h
parentf825cb9f6f5a01f2029c79a363a89047b482c788 (diff)
Session locking mechanism gone crazy. This needs a rewamp at some point.
Diffstat (limited to 'server/src/database.h')
-rw-r--r--server/src/database.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/server/src/database.h b/server/src/database.h
index a366f43..f3b42e2 100644
--- a/server/src/database.h
+++ b/server/src/database.h
@@ -62,6 +62,7 @@ public:
time_t now = time(NULL))
{
if(!dao) return;
+
mutex.lock();
DEBUG(db, "%s, %s, %s,...\n",
transaction.user.c_str(), transaction.cpr.c_str(),
@@ -79,7 +80,8 @@ public:
mutex.lock();
DEBUG(db, "%s, <%u fieldnames>, %ld\n",
patientid.c_str(), fieldnames.size(), oldest);
- Values values = dao->getLatestValues(sessionid, patientid, NULL, fieldnames, oldest);
+ Values values = dao->getLatestValues(sessionid, patientid,
+ NULL, fieldnames, oldest);
mutex.unlock();
return values;
}
@@ -172,6 +174,12 @@ public:
return dao->restore(data);
}
+ bool active()
+ {
+ if(!dao || sessionid == "") return false;
+ return dao->active(sessionId());
+ }
+
private:
PracroDAO *dao;
Mutex mutex;