"No session currently bound to execution context" using the legacy Hibernate interface in JBoss EAP
Issue
- Using the legacy/native Hibernate interface (
SessionFactory/Session) instead of the JPA interface (EntityManagerFactory/EntityManager) hibernate.current_session_context_classis set toorg.hibernate.context.internal.ManagedSessionContext-
Encountering an exception while obtaining a
Sessionreference... org.hibernate.HibernateException: No session currently bound to execution context at org.hibernate.context.internal.ManagedSessionContext.currentSession(ManagedSessionContext.java:58) at org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:497)
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 7
- Hibernate 5
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.