Bug 453179
| Summary: | Hibernate Session Context Configured Wrong | ||
|---|---|---|---|
| Product: | [Retired] JBoss Customer Support Portal | Reporter: | John Sanda <jsanda> |
| Component: | Web-General | Assignee: | JBoss CSP Bug Watch List <csp-bugs-watch> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 1.3.9 | CC: | fmerenda |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | MR8-CSP | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2009-01-30 17:37:41 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 453180, 463287 | ||
|
Description
John Sanda
2008-06-27 18:18:13 UTC
Changing the configuration to include, <property name="hibernate.current_session_context_class">thread</property> results in the following exception at start up: java.lang.ExceptionInInitializerError at com.jboss.jbossnetwork.ui.listeners.StartupListener.contextInitialized(StartupListener.java:28) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763) . . . Caused by: org.hibernate.HibernateException: Unable to locate current JTA transaction at org.hibernate.context.JTASessionContext.currentSession(JTASessionContext.java:61) at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:542) at com.jboss.jbossnetwork.dao.GenericHibernateDAO.getSession(GenericHibernateDAO.java:56) at com.jboss.jbossnetwork.dao.GenericHibernateDAO.findByCriteria(GenericHibernateDAO.java:335) at com.jboss.jbossnetwork.dao.GenericHibernateDAO.getAll(GenericHibernateDAO.java:199) at com.jboss.jbossnetwork.util.config.Config.<clinit>(Config.java:22) This is because Hibernate is trying to join a JTA transaction, but one has not been started. The code where the exception originates is not part of an EJB method invocation, hence the exception. We need to either refactor that code into an EJB method call so the container handles the transaction for us, or we need to explicitly create the transaction. This bug has been fix in a branch at https://svn.devel.redhat.com/repos/CSP/branches/developer-branches/jsanda/hibernate-testing. This was fixed and released in MR8. Hibernate is now configured to participate in JTA transactions. |