Hi everybody,

I am adapting an application based on Tapestry, EJBs and Hibernate. The
idea is to convert a subset the stateless session beans into CDI managed
beans in order to supply a CDI based component that could be used in both a
java SE and Java EE environment.  Unfortunately I fail to set a
transactional context for the entity managers that I inject in my CDI
managed beans. I am stuck. Maybe the solution if obvious for all of you…

I need to know the right scope I have to specify for the entity manager
producers.

@TransactionScope => The first access to the application gives a
org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active
contexts for scope type
org.apache.deltaspike.jpa.api.transaction.TransactionScoped

@RequestScope => An attempt to persist an update gives a
javax.persistence.TransactionRequiredException: no transaction is in
progress javax.persistence.TransactionRequiredException: JBAS011469

I have got a JTA datasource. Which transaction strategy do I have to
specify  in the beans.xml? BeanManagedUserTransactionStrategy?
ContainerManagedTransactionStrategy?

Many thanks for your help.

Pierre

Reply via email to