Replacement for org.hibernate.Transactions.isActive () in Hibernate 5

I am switching from hibernate 4.2.17 to 5.0.7, which has been working fine so far, but the method seems to be isActivedeprecated. I just can't use it anymore.

Here is my code:

public void starteTransaktion() {
        try {
            getMySession();

            if(!hibernateSession.getTransaction().isActive()) {
                hibernateSession.beginTransaction();
            }
        } catch (HibernateException e) {

        }
    }

I replaced all other methods, but I cannot find a replacement for this ...

Error message: method isActive()is undefined for type Transaction

+4
source share
1 answer

By 5.0 Javadoc :

hibernateSession.getTransaction().getStatus() != TransactionStatus.ACTIVE

+9
source

Source: https://habr.com/ru/post/1624412/


All Articles