List pagination locking for state-data changes
Changed semantics of locking: instead of relying of locking running-db, an automatic lock bound to a session is maintained. When the session closes the lock is released.
This commit is contained in:
parent
197fc16e69
commit
eea6d549f6
5 changed files with 25 additions and 19 deletions
|
|
@ -592,11 +592,16 @@ get_list_pagination(clicon_handle h,
|
|||
#endif
|
||||
}
|
||||
else {/* Check if running locked (by this session) */
|
||||
if ((iddb = xmldb_islocked(h, "running")) != 0 &&
|
||||
iddb == ce->ce_id)
|
||||
if ((iddb = xmldb_islocked(h, PAGINATE_STATE_LOCK)) != 0){
|
||||
if (iddb == ce->ce_id)
|
||||
locked = 1;
|
||||
else
|
||||
locked = 0;
|
||||
}
|
||||
else {
|
||||
xmldb_lock(h, PAGINATE_STATE_LOCK, ce->ce_id);
|
||||
locked = 1;
|
||||
else
|
||||
locked = 0;
|
||||
}
|
||||
if ((ret = clixon_pagination_cb_call(h, xpath, locked,
|
||||
offset, limit,
|
||||
xret)) < 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue