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 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3921727#3921727

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3921727


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to