5

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

Bacteria
  • 8,406
  • 10
  • 50
  • 67
Pascal Petruch
  • 344
  • 3
  • 16

1 Answers1

11

As per 5.0 Javadoc:

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

mindas
  • 26,463
  • 15
  • 97
  • 154