deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juliano Marques <juliano...@gmail.com>
Subject Re: Deltaspike Data Module
Date Thu, 14 Aug 2014 12:04:55 GMT
With Wildfly 8, the alternative in beans.xml do not work, but the global
alternative in apache-deltaspike.properties works.
I had a problem with Deltaspike repositories and JTA datasources, and this
resolves the problem.
Thanks.

Atenciosamente,

*Juliano M.*



On Thu, Aug 14, 2014 at 8:15 AM, Rafael Benevides <benevides@redhat.com>
wrote:

> Yes. It's possible.
>
> Depending on your implementation, You may need to register the
> `org.apache.deltaspike.jpa.impl.transaction.ContainerManagedTransactionStrategy`
> as an alternative on your beans.xml
>
> or registered as globalAlternatives.org.apache.deltaspike.jpa.spi.
> transaction.TransactionStrategy=org.apache.deltaspike.jpa.impl.
> transaction.ContainerManagedTransactionStrategy on your
> apache-deltaspike.properties if it doesn't work out of the box.
>
> Em 8/14/14, 4:24, Juliano Marques escreveu:
>
>> Hi,
>>
>> I want to use Deltaspike Data Module repositories, but I want to control
>> transactions with EJBs, not within the repository, something like this:
>>
>> @Dependent
>> @Repository
>> public interface UnidadeRepository2 extends EntityRepository<Unidade,
>> Long>
>> {
>> }
>>
>> @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
>> public class UnidadeEJB {
>>
>>      @Inject
>>      private UnidadeRepository2 repository;
>>
>>      @TransactionAttribute(TransactionAttributeType.REQUIRED)
>>      public Unidade save(Unidade unidade) {
>>          return repository.saveAndFlush(unidade);
>>      }
>> }
>>
>> Is this possible?
>>
>>
>> Regards,
>>
>> *Juliano M.*
>>
>>
>

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