user7274250
user7274250

Reputation: 31

HibernateException:Current Transaction is not in progress on Wildfly 10 after migrating to Hibernate 5

I am running Hibernate 5 on EJB3 and wildfly 10 some requests fail on first Hibernate call with

org.hibernate.HibernateException: Current transaction is not in progress 

when I am trying to call sessionFactory().getCurrentSession() method. (Using JTATransactionManager to manage transaction in hibernate.cfg.xml)

Upvotes: 3

Views: 6791

Answers (1)

Matteo Baldi
Matteo Baldi

Reputation: 5828

That exception indicate that you're trying to get the current session no with available transaction. If you don't want to explicitly use .openSession().beginTransaction() make sure that your transaction attribute is set to REQUIRED or REQUIRES_NEW.

Upvotes: 1

Related Questions