替换为Hibernate中的org.hibernate.Transactions.isActive()5 [英] Replacement for org.hibernate.Transactions.isActive() in Hibernate 5
问题描述
我从hibernate 4.2.17迁移到5.0.7,到目前为止工作正常,但似乎不推荐使用 isActive
方法。
这是我的代码:
public void starteTransaktion(){
try {
getMySession();
if(!hibernateSession.getTransaction()。isActive()){
hibernateSession.beginTransaction();
catch(HibernateException e){
}
}
我替换了所有其他方法,但我无法完全找到替代方法......
错误消息:方法 isActive()
未定义为类型Transaction
href =http://docs.jboss.org/hibernate/orm/5.0/javadocs/org/hibernate/resource/transaction/spi/TransactionStatus.html =noreferrer> 5.0 Javadoc :
hibernateSession.getTransaction()。getStatus()!= TransactionStatus.ACTIVE
I'm migrating from hibernate 4.2.17 to 5.0.7 which works fine so far, but it seems that the method isActive
is deprecated. I just can't use it anymore.
Here's my code:
public void starteTransaktion() {
try {
getMySession();
if(!hibernateSession.getTransaction().isActive()) {
hibernateSession.beginTransaction();
}
} catch (HibernateException e) {
}
}
I substituted all other methods, but I can't quite find a replacement for this...
Error message: The method isActive()
is undefined for the type Transaction
As per 5.0 Javadoc:
hibernateSession.getTransaction().getStatus() != TransactionStatus.ACTIVE
这篇关于替换为Hibernate中的org.hibernate.Transactions.isActive()5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!