From 8000cf7048feffaa6c5ea37cdfb079b09de5c506 Mon Sep 17 00:00:00 2001 From: Gil Moskowitz Date: Thu, 25 Sep 2014 15:53:08 -0400 Subject: [PATCH] re-establish the link between qt and web client locking --- .../database/source/xt/functions/pg_advisory_unlock.sql | 4 ---- enyo-client/database/source/xt/functions/trylock.sql | 4 ---- 2 files changed, 8 deletions(-) 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}); -- 2.39.2