deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierre De Swert <pierre.desw...@gmail.com>
Subject How-to initialize the transactional context ?
Date Wed, 16 Dec 2015 15:35:30 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message