我发现此错误发生在 SQL 插入语句运行后。SQL 由从 Java 执行的存储过程调用。请看下图。
=== 2012-03-23 20:39:13 Insert statement procedure executed ===
2012-03-23 21:16:01 CST:[local]:user@report:[1591]:FATAL: 57P01: terminating connection due to administrator command
2012-03-23 21:16:01 CST:[local]:user@report:[1591]:LOCATION: ProcessInterrupts, postgres.c:2662
2012-03-23 21:16:01 CST:[local]:user@report:[656]:NOTICE: 00000: Slony-I: cleanup stale sl_nodelock entry for pid=1583
2012-03-23 21:16:01 CST:[local]:user@report:[656]:LOCATION: exec_stmt_raise, pl_exec.c:2298
2012-03-23 21:22:55 CST:[local]:user@app:[17236]:NOTICE: 00000: Slony-I: cleanup stale sl_nodelock entry for pid=1590
2012-03-23 21:22:55 CST:[local]:user@app:[17236]:CONTEXT: SQL statement "SELECT "_slon_rep".cleanupNodelock()"
PL/pgSQL function "cleanupevent" line 77 at PERFORM
2012-03-23 21:22:55 CST:[local]:user@app:[17236]:LOCATION: exec_stmt_raise, pl_exec.c:2298
2012-03-23 21:22:55 CST:[local]:user@app:[17236]:NOTICE: 00000: Slony-I: cleanup stale sl_nodelock entry for pid=1634
2012-03-23 21:22:55 CST:[local]:user@app:[17236]:CONTEXT: SQL statement "SELECT "_slon_rep".cleanupNodelock()"
PL/pgSQL function "cleanupevent" line 77 at PERFORM
2012-03-23 21:22:55 CST:[local]:user@app:[17236]:LOCATION: exec_stmt_raise, pl_exec.c:2298
=== 2012-03-23 22:15:04 Insert statement procedure return release signal to Java ===
我的数据库中有 2 个模式。“app” 和 “report” 两者都是由 Slony 相互同步的。我检查了表格,发现这些记录是从20:39:13开始插入的。我担心的一点是为什么 Postgres 在22:15:04向 Java 返回释放信号,因为插入语句已经在20:39:13执行。我想上面的过程受到了插入语句的影响,过程被挂起,需要等到它完成然后释放到Java。
提前谢谢停止:)