Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D67B0200C73 for ; Wed, 10 May 2017 11:22:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D444D160BB4; Wed, 10 May 2017 09:22:59 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id F34CD160BA8 for ; Wed, 10 May 2017 11:22:58 +0200 (CEST) Received: (qmail 58055 invoked by uid 500); 10 May 2017 09:22:58 -0000 Mailing-List: contact users-help@deltaspike.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@deltaspike.apache.org Delivered-To: mailing list users@deltaspike.apache.org Received: (qmail 58031 invoked by uid 99); 10 May 2017 09:22:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 May 2017 09:22:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 1A538C11AB for ; Wed, 10 May 2017 09:22:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.12 X-Spam-Level: X-Spam-Status: No, score=-0.12 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.de Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id AcCulMAN4Fld for ; Wed, 10 May 2017 09:22:53 +0000 (UTC) Received: from nm12-vm6.bullet.mail.ne1.yahoo.com (nm12-vm6.bullet.mail.ne1.yahoo.com [98.138.91.105]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id AA96A5F521 for ; Wed, 10 May 2017 09:22:52 +0000 (UTC) Received: from [98.138.100.115] by nm12.bullet.mail.ne1.yahoo.com with NNFMP; 10 May 2017 09:22:46 -0000 Received: from [98.138.104.115] by tm106.bullet.mail.ne1.yahoo.com with NNFMP; 10 May 2017 09:22:46 -0000 Received: from [127.0.0.1] by smtp224.mail.ne1.yahoo.com with NNFMP; 10 May 2017 09:22:46 -0000 X-Yahoo-Newman-Id: 445541.58914.bm@smtp224.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Duuu1AgVM1mZF8JM.K64iiS1V25T6IEQvO7fSMLSnoVXnZw kdvDCKZ0UFi3zzqKcKiGzJ6LU5.IHCruc5zB4_H0axr7akvo1jBqxbJryonq oCRlGb43hv_jrBivzyfjo1MxrnhPuyPtz4omHVvTvS.2FcJw1o74FPfkCnNe dOcmcZE9L2vBWu8Hy018bAOUUGn34dCbHckhaeaBGsRSeah4xP9c0XekBa0r Yn7j3nAd7RfsD1jQvUORsjX8Nc.oKZYWB1kbUXyVJ_a0xeGUDK7PAUbbKkPM 70QW0Z73.yLO4TFcFDcxGoyBvu0K63l1D.9aa7fogcl0A.ZSRm_6jJJDDWof o4b7vocsbpl1VxvlbUgS2X4yyXVi49uiWpIELkzuTAL63aJIG7ADBn1L9m5r Tlkw1hUtQmS1r95vJYVpGx9EF2znoVbUbC_RdrGPP.jhQ82ypqE7z9M54CPu Ijjt7ptSI6CCc5UZ8p10oOGugdPg9LJb1GaeHwwwva3y7WbF7EeSvDgYEGp1 z.aMia1My5ArrM0CIK42wL_IlEz2gwr07AQDj.cs- X-Yahoo-SMTP: 81dhI.iswBBq7boyzRoOX6xuRIe8 From: Mark Struberg Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: DeltaSpike Data - What application servers are supported? Date: Wed, 10 May 2017 11:22:44 +0200 References: To: users@deltaspike.apache.org In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3273) archived-at: Wed, 10 May 2017 09:23:00 -0000 Hi Konrad, John! Hmm not sure about ContainerManagedTransactionStrategy.=20 Look at the code, this is probably not named properly. It is essentially = a no-op TransactionStrategy. It delegates through without doing = something. This is useful if you GUARANTEED have a ContainerManagedTransation in an = outer level.=20 E.g. if you have some existing code using DeltaSpike @Transactional, and = you know that you ALWAYS have e.g. a @Stateless @WebService calling your = code. We cannot rename this now because otherwise the Alternatives enabled in = various beans.xml files would go bonkers... So if you are about to use e.g. an @ApplicationScoped @Transactional = bean without any EJBs involved at all, then you should rather use the = BeanManagedUserTransactionStrategy. This one leverages the UserTransaction functionality provided by the = server. If a JTA Transaction is already active then it would simply do = nothing. So in this case it really behaves the same like = ContainerManagedTransactionStrategy.=20 But if there is NO active Transaction, then it will use the = UserTransaction API to open a transaction and to commit/rollback on this = very layer when leaving the intercepted method. Subsequently invoked = @Transactional CDI beans - and even EJBs! - will just take this open = transaction and work with it. So this works perfectly fine in cases where you only use CDI but also = when you wildly mix EJBs and CDI beans. I use this in production for quite a few projects. Note that the EntityManagerProducer you need to provide must use a = container provided EntityManagerFactory, otherwise your EntityManager = won't integrate with JTA. A sample can be found here: = https://github.com/struberg/lightweightEE/blob/jtacdi11/backend/src/main/j= ava/de/jaxenter/eesummit/caroline/backend/tools/EntityManagerProducer.java= #L40 hth. LieGrue, strub > Am 09.05.2017 um 01:50 schrieb John D. Ament : >=20 > Konrad, >=20 > When you specify globalAlternatives, you don't need to specify = anything in > beans.xml >=20 > RE which strategy to use, it'll be the one that matches your = transaction > mode. If you're using plain JTA just use > ContainerManagedTransactionStrategy. >=20 > John >=20 > On Mon, May 8, 2017 at 3:56 PM Instantiation Exception < > instantiationexception@gmail.com> wrote: >=20 >> John, >>=20 >> I want to clarify one thing. When I use >> META-INF/apache-deltaspike.properties with >> globalAlternatives.org.apache.deltaspike.jpa.spi.transaction. >> TransactionStrategy=3Dorg.apache.deltaspike.jpa.impl.transaction. >> ContainerManagedTransactionStrategy >>=20 >> should I use alternative in beans.xml? And which one? >> = org.apache.deltaspike.jpa.impl.transaction.ContainerManagedTransactionStr >> ategy >> or >> = org.apache.deltaspike.jpa.impl.transaction.BeanManagedUserTransactionStrat= egy >>=20 >> Best regards, >> Konrad >>=20 >> On Fri, Mar 3, 2017 at 2:57 PM, John D. Ament >> wrote: >>=20 >>> Ondrej, >>>=20 >>> I agree as well. It definitely should be more turn key in this = respect. >>>=20 >>> John >>>=20 >>> On Fri, Mar 3, 2017 at 8:53 AM Ondrej Mih=C3=A1lyi = >>> wrote: >>>=20 >>>> Hi John, >>>>=20 >>>> It sounds to me that DeltaSpike could be improved to make a >> sophisticated >>>> guess to infer the default value of this configuration from the >> container >>>> it is running in. At least for WildFly and maybe some other = containers >>>> where people report problems. >>>>=20 >>>> Just an idea :) >>>>=20 >>>> Ondrej >>>>=20 >>>> 2017-03-03 12:05 GMT+01:00 John D. Ament : >>>>=20 >>>>> Hi Konrad, >>>>>=20 >>>>> What that's referring to is that you need to create a >>>>> META-INF/apache-deltaspike.properties and add the following line: >>>>>=20 >>>>> globalAlternatives.org.apache.deltaspike.jpa.spi.transaction. >>>>> TransactionStrategy=3Dorg.apache.deltaspike.jpa.impl.transaction. >>>>> ContainerManagedTransactionStrategy >>>>>=20 >>>>> I do something similar to you, and it works perfect. I'm using >> maven >>> to >>>>> build a WAR file, so it just goes in >>>>> src/main/resources/META-INF/apache-deltaspike.properties >>>>>=20 >>>>> John >>>>>=20 >>>>> On Fri, Mar 3, 2017 at 3:38 AM Instantiation Exception < >>>>> instantiationexception@gmail.com> wrote: >>>>>=20 >>>>>> Hi, >>>>>>=20 >>>>>> In my company projects we use WildFly. In the past I tried few >> times >>> to >>>>> use >>>>>> DeltaSpike Data, but it didn't work. I configured everything >>> according >>>> to >>>>>> documentation. In pure CDI scenario it worked. But when I created >>>>>> @Dependent @Repository and injected it to @Stateless EJB I got = some >>>>>> transaction errors when tried to call EJB methods. In >> documentation I >>>> see >>>>>> warning: >>>>>>=20 >>>>>> Some containers do not support = BeanManagedUserTransactionStrategy! >>> As >>>>> JTA >>>>>>> has still some portability issues even in Java EE 7, it might be >>>>> required >>>>>>> that you implement your own TransactionStrategy. We will think >>> about >>>>>>> providing an acceptable solution for this. >>>>>>=20 >>>>>>=20 >>>>>> Is it about WildFly? Is WildFly supported? >>>>>>=20 >>>>>> Best regards, >>>>>> Konrad >>>>>>=20 >>>>>=20 >>>>=20 >>>=20 >>=20