Hibernate failure due to missing active transaction on @Transactional annotated method

Solution Verified - Updated -

Issue

We have created a custom login module for our portal solution deployed on JPP 6. During authentication a method annotated with @Transactional throws this exception:

[org.custom.LoginModule] getNamedQuery is not valid without active transaction: org.hibernate.HibernateException: getNamedQuery is not valid without active transaction.

Why is there no valid transaction while the called method is annotated to require transactions?

Environment

  • Red Hat JBoss Portal
    • 6.1.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content