postgresql – 在CentOS上与Postgres 8.4.3进行的准备交易

我在本地postgres.config中将’max_prepared_transactions’设置为20,但事务失败并显示以下错误跟踪(但仅限在 Linux上).因为在Windows中,相同的代码无缝地工作,如果这不是许可问题,我就会徘徊.什么是解决方案?
谢谢
彼得

372300 [Atomikos:7] WARN atomikos - XA resource 'XADBMS': rollback for XID '3137332E3230332E3132362E3139302E746D30303030313030303037:3137332E3230332E3132362E3139302E746D31' raised -3: the XA resource detected an internal error
org.postgresql.xa.PGXAException: Error rolling back prepared transaction
        at org.postgresql.xa.PGXAConnection.rollback(PGXAConnection.java:357)
        at com.atomikos.datasource.xa.XAResourceTransaction.rollback(XAResourceTransaction.java:873)
        at com.atomikos.icatch.imp.RollbackMessage.send(RollbackMessage.java:90)
        at com.atomikos.icatch.imp.PropagationMessage.submit(PropagationMessage.java:86)
        at com.atomikos.icatch.imp.Propagator$PropagatorThread.run(Propagator.java:62)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
        at java.lang.Thread.run(Thread.java:595)
Caused by: org.postgresql.util.PSQLException: ERROR: prepared transaction with identifier "1096044365_MTczLjIwMy4xMjYuMTkwLnRtMDAwMDEwMDAwNw==_MTczLjIwMy4xMjYuMTkwLnRtMQ==" does not exist
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:299)
        at org.postgresql.xa.PGXAConnection.rollback(PGXAConnection.java:347)
编辑帮助其他人搜索相同症状的见解

该错误表明您仍然超过了max_prepared_transactions限制.

确保您编辑的配置文件是正在使用的配置文件,并且您已告诉postgresql重新加载其配置以获取已编辑的max_prepared_transactions.

您可以使用SQL查询数据库以查找该设置的用途:

SHOW max_prepared_transactions;

原始答案遵循(基于max_prepared_transactions设置正确的假设):

你在使用setAutoCommit()吗?您可能正在遇到这个最近发现的错误:

http://archives.postgresql.org/pgsql-jdbc/2010-03/msg00013.php

这篇文章展示了一些准备XA连接的小型可重复测试,你可以看看你是否做了类似的事情:

http://archives.postgresql.org/pgsql-jdbc/2009-01/msg00025.php

相关文章
相关标签/搜索