English 中文(简体)
Hibernate 3.6.7至4.0.1的升级,冻结的交易
原标题:Hibernate 3.6.7 to 4.0.1 upgrade, nested transactions

I m试图从3.6.7升至4.0.1,从JD1.6升至JDK 1.7。

在调离配置文件后,正直...... 我可以申请罚款。

首先是我的特权。

<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory< /property>
<property name="current_session_context_class">thread</property>

But I m facing 1 a problem with nested sessionFactory.getCurrentSession().beginTransaction() This used to be working in hibernate 3.6.7, though without a "hibernate.transaction.factory_class" property.

任何人都把一杯子 to到我做错了什么?

追踪也一样:

org.hibernate.TransactionException: nested transactions not supported
at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.begin(AbstractTransactionImpl.java:152)
at org.hibernate.internal.SessionImpl.beginTransaction(SessionImpl.java:1263)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.hibernate.context.internal.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:350)
at $Proxy4.beginTransaction(Unknown Source)
问题回答

阅读文件时,它认为Hibernate从来不支持冻结的交易,这在Hibernate 4中执行,因为这一类“摘要交易”以前就存在过。

我不知道你试图用冻结的交易解决什么问题,但可能还有一种替代方法,只使用单一交易。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签