1

我正在 Windows 上使用 Spring 和 PostgreSQL 9.2 创建一个应用程序。我在 Windows 32 位操作系统中成功运行了这个应用程序。但是当我尝试在 Windows 64 位操作系统中运行相同的应用程序时,我得到以下异常:

Caused by: org.springframework.transaction.HeuristicCompletionException: Heuristic completion: outcome state is mixed; nested exception is javax.transaction.HeuristicMixedException: Heuristic Exception
    at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1016)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:393)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
    at com.kensho.common.UIbundlDAOImpl$$EnhancerByCGLIB$$ca55a3ce.findAll(<generated>)
    at com.kensho.common.UIToolKitAdminBBean.getAllBundleItems(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:346)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:299)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:132)
    ... 38 more
Caused by: javax.transaction.HeuristicMixedException: Heuristic Exception
    at com.atomikos.icatch.jta.TransactionImp.rethrowAsJtaHeuristicMixedException(TransactionImp.java:77)
    at com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:238)
    at com.atomikos.icatch.jta.TransactionManagerImp.commit(TransactionManagerImp.java:498)
    at com.atomikos.icatch.jta.UserTransactionImp.commit(UserTransactionImp.java:129)
    at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1009)
    ... 53 more
Caused by: com.atomikos.icatch.HeurHazardException: Heuristic Exception
    at com.atomikos.icatch.imp.CoordinatorStateHandler.rollback(CoordinatorStateHandler.java:802)
    at com.atomikos.icatch.imp.ActiveStateHandler.prepare(ActiveStateHandler.java:223)
    at com.atomikos.icatch.imp.CoordinatorImp.prepare(CoordinatorImp.java:833)
    at com.atomikos.icatch.imp.CoordinatorImp.terminate(CoordinatorImp.java:1160)
    at com.atomikos.icatch.imp.CompositeTerminatorImp.commit(CompositeTerminatorImp.java:92)
    at com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:236)

.... 为什么我会遇到这个问题?

4

1 回答 1

2

max_connection与 PostgreSQL 9.x 和 10.x 一起,这个问题在 Seam 和 Apache JCR以及max_prepared_transactionsPostgreSQL 配置中的值太低时遇到过。

于 2018-11-07T15:27:36.057 回答