From: Gil Moskowitz Date: Thu, 25 Sep 2014 19:53:08 +0000 (-0400) Subject: re-establish the link between qt and web client locking X-Git-Tag: v4.7.0-beta.2~3^2 X-Git-Url: http://git.roojs.org/?p=xtuple;a=commitdiff_plain;h=8000cf7048feffaa6c5ea37cdfb079b09de5c506 re-establish the link between qt and web client locking --- diff --git a/enyo-client/database/source/xt/functions/pg_advisory_unlock.sql b/enyo-client/database/source/xt/functions/pg_advisory_unlock.sql index 25c3b7aff..c892882ca 100644 --- a/enyo-client/database/source/xt/functions/pg_advisory_unlock.sql +++ b/enyo-client/database/source/xt/functions/pg_advisory_unlock.sql @@ -1,8 +1,4 @@ create or replace function xt.pg_advisory_unlock(oid integer, id integer) returns boolean as $$ - var sql = "select pg_catalog.pg_advisory_unlock($1, $2) as result;"; - return plv8.execute(sql, [oid, id])[0].result; - /* temporary: let qt client use advisory locks but web client use xt.lock */ - var pid = plv8.execute("select pg_backend_pid() as pid;")[0].pid, username = plv8.execute("select geteffectivextuser() as username;")[0].username, sql = "select * from xt.lock where lock_table_oid = $1 and lock_record_id = $2 and lock_username = $3 and lock_pid = $4;", diff --git a/enyo-client/database/source/xt/functions/trylock.sql b/enyo-client/database/source/xt/functions/trylock.sql index 719607b4d..0c73312f6 100644 --- a/enyo-client/database/source/xt/functions/trylock.sql +++ b/enyo-client/database/source/xt/functions/trylock.sql @@ -1,8 +1,4 @@ create or replace function xt.trylock(oid integer, id integer) returns boolean as $$ - var sql = "select public.trylock($1, $2) as result;"; - return plv8.execute(sql, [oid, id])[0].result; - /* temporary: let qt client use advisory locks but web client use xt.lock */ - var pid = plv8.execute("select pg_backend_pid() as pid;")[0].pid, data = Object.create(XT.Data), lock = data.tryLock(oid, id, {pid: pid});