【问题标题】:hibernate 4 jta webpshere休眠 4 jta websphere
【发布时间】:2013-11-27 23:04:56
【问题描述】:

有没有人有一个很好的例子来说明如何使用休眠 4.2 设置 Wepsphere 8。我们没有使用 EJB。

在 hibernate.properties 中使用以下配置时

hibernate.transaction.jta.platform=org.hibernate.service.jta.platform.internal.WebSphereExtendedJtaPlatform

在没有其他属性的情况下,我们在进行 2 阶段提交(数据库和 MQ)时收到以下消息

[11/27/13 17:30:20:330 EST] 00000024 LocalTranCoor W WLTC0032W:在清除 LocalTransactionContainment 期间回滚了一个或多个本地事务资源。

如果我们把hibernate.properties改成下面这样

hibernate.transaction.factory_class=org.hibernate.engine.transaction.internal.jta.JtaTransactionFactory hibernate.transaction.jta.platform=org.hibernate.service.jta.platform.internal.WebSphereExtendedJtaPlatform

我们收到以下信息: org.hibernate.engine.transaction.internal.jta.JtaTransaction afterAfterCompletion HHH000426:你应该设置hiberna te.transaction.manager_lookup_class 是否启用缓存

这也会导致: [11/27/13 14:31:18:526 EST] 00000035 SystemErr R org.hibernate.exception.GenericJDBCException:无法使用 next() 推进 [11/27/13 14:31:18:527 EST] org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)的 00000035 SystemErr R [11/27/13 14:31:18:527 EST] org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) 处的 SystemErr R 00000035

【问题讨论】:

    标签: java hibernate websphere jta


    【解决方案1】:

    我们找到了答案。如果我们将 factory_class 设置为 org.hibernate.engine.transaction.internal.jta.JtaTransactionFactory。然后我们会受到 webpshere 中的 JTA 设置的约束,这会导致事务超时。

    【讨论】:

      猜你喜欢
      • 2023-03-15
      • 1970-01-01
      • 2016-01-12
      • 2018-09-06
      • 1970-01-01
      • 1970-01-01
      • 2023-03-18
      • 2014-10-26
      • 1970-01-01
      相关资源
      最近更新 更多