谁有一个很好的例子,如何使用hibernate 4.2设置Wepsphere 8。我们没有使用EJB。
在hibernate.properties中使用以下配置时
hibernate.transaction.jta.platform=org.hibernate.service.jta.platform.internal.WebSphereExtendedJtaPlatform
在没有其他属性的情况下,我们在执行两阶段提交(数据库和MQ)时会收到以下消息
11/27/13 17:30:20:330EST 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:如果启用了缓存,则应设置休眠te.transaction.manager_lookup_class
这也会导致: 11/27/13 14:31:18:526 EST 00000035 SystemErr R org.hibernate.exception.GenericJDBCException: causes using 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)
发布于 2013-12-07 04:48:23
我们找到了答案。如果我们设置将factory_class设置为org.hibernate.engine.transaction.internal.jta.JtaTransactionFactory.然后,我们受到webpshere中的JTA设置的约束,这将使事务超时。
https://stackoverflow.com/questions/20254819
复制相似问题