I have a stateless session bean with a method annotated with the transaction attribute type SUPPORTS. The method performs a read-only query. I can't get that to work. I always get the following stack trace:
javax.persistence.TransactionRequiredException: EntityManager must be access within a transaction
at org.jboss.ejb3.entity.ManagedEntityManagerFactory.getSession(ManagedEntityManagerFactory.java:124)
at org.jboss.ejb3.entity.InjectedEntityManager.getSession(InjectedEntityManager.java:154)
at org.jboss.ejb3.entity.InjectedEntityManager.createQuery(InjectedEntityManager.java:67)
...
Why is that? How do I perform a read-only query without enforcing a new transaction?
TIA
Thomas Hallgren
This is a bug
http://jira.jboss.com/jira/browse/EJBTHREE-418