hibernate 4 jta websphere

时间:2013-11-27 23:04:56

标签: java hibernate websphere jta

有没有人有一个很好的例子,说明如何使用hibernate 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] 00000035 SystemErr R at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54) [11/27/13 14:31:18:527 EST] 00000035 SystemErr R at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)

1 个答案:

答案 0 :(得分:1)

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

相关问题