我有一个使用Postgres 9.3的Java Web应用程序。每当Web服务器启动时,它都会使用以下查询获取数据库锁定:
select pg_try_advisory_lock(100);
Run Code Online (Sandbox Code Playgroud)
但是,当我停止服务器时,它不会释放它先前获得的互斥锁。
postgres=# SELECT pl.pid,datname,mode, state FROM pg_locks pl LEFT JOIN pg_stat_activity psa ON pl.pid = psa.pid;
pid | datname | mode | state
-------+----------------------+-----------------+--------
5217 | postgres | AccessShareLock | active
5217 | postgres | AccessShareLock | active
5217 | postgres | ExclusiveLock | active
5217 | postgres | AccessShareLock | active
5217 | postgres | AccessShareLock | active
5217 | postgres | AccessShareLock | active
5217 | postgres | AccessShareLock | active …Run Code Online (Sandbox Code Playgroud) 我想从父窗口发送一些事件/数据到它的子窗口。我怎么能这样做?
我试过postMessage,但没有用。