Hi all, I'm using openejb 3.1 + Tomcat 6.0.18. 

My question is can I use @PersistenceContext to inject EntityManager and
into Singleton beans?

I have configured the persistence-unit with type="TRANSACTION" and
@PersistenceContext worked fine on Stateful and Stateless beans. 

But when I use the same way to inject EntityManager into a Singleton(also
annotated @Startup) and tried to persist() something, openejb logged
TransactionRequiredException and failed to deploy the app.

Am I mistakenly understanding the documents? I've searched over the openejb
official site but couldn't find any examples about this. Many thanks!
-- 
View this message in context: 
http://www.nabble.com/Cannot-persist%28%29-in-%40Singletons--tp22468590p22468590.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Reply via email to