Return-Path: Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: (qmail 18520 invoked from network); 16 Mar 2010 13:33:19 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Mar 2010 13:33:19 -0000 Received: (qmail 87177 invoked by uid 500); 16 Mar 2010 13:33:19 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 87125 invoked by uid 500); 16 Mar 2010 13:33:19 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 87096 invoked by uid 99); 16 Mar 2010 13:33:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Mar 2010 13:33:19 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mwessendorf@gmail.com designates 209.85.219.210 as permitted sender) Received: from [209.85.219.210] (HELO mail-ew0-f210.google.com) (209.85.219.210) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Mar 2010 13:33:12 +0000 Received: by ewy2 with SMTP id 2so1566558ewy.0 for ; Tue, 16 Mar 2010 06:32:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=/1ymkb32LJfcPpOG6x8jK1L4b7/ZlfifFdQKc0cO9LE=; b=WhbyGjUWbX0njNkcmXBZ1PARFqUIIXjJ4wf/XQoXZ2o/wNTSmyvSPdXcmf21BokmnK 7Cr1QgHkceuwOQ8OGUhjHQ8FfLWaA4cQqtllf1ryArOfmc+vy9mE4M2CwR1DZRT7roBk tP1DNX+wWRXut055KHojhFgGuQXMteiPR4kUg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=uObNJlOnDZDsy1d8PQ3Kiln79QYuy6+i38MpatN+I6ERnXNYOQfHu9a4XQmrW4hQlN hkqf4vhMM2ZwZa0Vkd/vIRX8Hgm9gMhI+KevfoxIL58l+Yl3kRNTCDpL9KLhHVUnwiCW T2HDgmZrwItWubDfEafS4H52eC6U9C9+jW65o= MIME-Version: 1.0 Sender: mwessendorf@gmail.com Received: by 10.216.88.20 with SMTP id z20mr617131wee.222.1268746372159; Tue, 16 Mar 2010 06:32:52 -0700 (PDT) In-Reply-To: References: <186435.7090.qm@web27801.mail.ukl.yahoo.com> <2332f63b1002150443o3b918c6cx68abcafb52118c1@mail.gmail.com> <2332f63b1003041139g4a9b0973t1e7f61e90e4810ff@mail.gmail.com> <71235db41003152144s49a6d842i57e75042cb7f042c@mail.gmail.com> Date: Tue, 16 Mar 2010 06:32:52 -0700 X-Google-Sender-Auth: 8cc7e4f28574c572 Message-ID: <71235db41003160632x2dc9c560nbd000c50f5bb40f0@mail.gmail.com> Subject: Re: [Ext-CDI] @Transactional From: Matthias Wessendorf To: MyFaces Development Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Mar 16, 2010 at 1:18 AM, Arne Limburg wrote: > Hi Matthias, > > I used Weld to test it and it does not complain anything ;-) I was guessing that ;-) > I wonder why it is a problem to have the EntityManagerProducer @Applicati= onScoped. The returned EntityManagers are @Dependent scoped. I'll take a lo= ok at what the spec says about this. I need to do some rework to make the E= ntityManagerProducer @Dependent scoped. The state must be moved to another = bean that is @ApplicationScoped. That bean then can be injected into the En= tityManagerProducer. > I think I will do some OWB debugging (and double checking the spec) 2nite, regarding the error that we see. > Regards, > Arne > > -- > > Arne Limburg - Enterprise Developer > OpenKnowledge GmbH, Oldenburg > Bismarckstra=DFe 13, 26122 Oldenburg > Mobil: +49 (0) 170 - 2733627 > Tel: +49 (0) 441 - 4082-0 > Fax: +49 (0) 441 - 4082-111 > arne.limburg@openknowledge.de > http://www.openknowledge.de > > Registergericht: Amtsgericht Oldenburg, HRB 4670 > Gesch=E4ftsf=FChrer: Lars R=F6wekamp, Jens Schumann > > -----Urspr=FCngliche Nachricht----- > Von: mwessendorf@gmail.com [mailto:mwessendorf@gmail.com] Im Auftrag von = Matthias Wessendorf > Gesendet: Dienstag, 16. M=E4rz 2010 05:44 > An: MyFaces Development > Betreff: Re: [Ext-CDI] @Transactional > > HEllo Arne, > > what version of OWB did you use? > Or did you use Weld? > > on deployment I get the following error (2times): > SEVERE: > org.apache.webbeans.exception.WebBeansConfigurationException: Bean > Name:null,WebBeans Type:MANAGED,API > Types:[java.lang.Object,org.apache.myfaces.codi.EntityManagerProducer],Qu= alifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]scope > can not define other scope except @Dependent to inject InjectionPoint > =A0 =A0 =A0 =A0at org.apache.webbeans.container.BeanManagerImpl.validate(= BeanManagerImpl.java:1001) > =A0 =A0 =A0 =A0at org.apache.webbeans.config.BeansDeployer.validate(Beans= Deployer.java:346) > =A0 =A0 =A0 =A0at org.apache.webbeans.config.BeansDeployer.validateInject= ionPoints(BeansDeployer.java:301) > =A0 =A0 =A0 =A0at org.apache.webbeans.config.BeansDeployer.deploy(BeansDe= ployer.java:154) > =A0 =A0 =A0 =A0at org.apache.webbeans.lifecycle.AbstractLifeCycle.startAp= plication(AbstractLifeCycle.java:120) > =A0 =A0 =A0 =A0at org.apache.webbeans.web.lifecycle.WebContainerLifecycle= .startApplication(WebContainerLifecycle.java:75) > =A0 =A0 =A0 =A0at org.apache.webbeans.servlet.WebBeansConfigurationListen= er.contextInitialized(WebBeansConfigurationListener.java:66) > =A0 =A0 =A0 =A0at org.mortbay.jetty.handler.ContextHandler.startContext(C= ontextHandler.java:548) > =A0 =A0 =A0 =A0at org.mortbay.jetty.servlet.Context.startContext(Context.= java:136) > =A0 =A0 =A0 =A0at org.mortbay.jetty.webapp.WebAppContext.startContext(Web= AppContext.java:1239) > =A0 =A0 =A0 =A0at org.mortbay.jetty.handler.ContextHandler.doStart(Contex= tHandler.java:517) > =A0 =A0 =A0 =A0at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppCo= ntext.java:466) > =A0 =A0 =A0 =A0at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doSt= art(Jetty6PluginWebAppContext.java:124) > =A0 =A0 =A0 =A0at org.mortbay.component.AbstractLifeCycle.start(AbstractL= ifeCycle.java:50) > =A0 =A0 =A0 =A0at org.mortbay.jetty.handler.HandlerCollection.doStart(Han= dlerCollection.java:152) > =A0 =A0 =A0 =A0at org.mortbay.jetty.handler.ContextHandlerCollection.doSt= art(ContextHandlerCollection.java:156) > =A0 =A0 =A0 =A0at org.mortbay.component.AbstractLifeCycle.start(AbstractL= ifeCycle.java:50) > =A0 =A0 =A0 =A0at org.mortbay.jetty.handler.HandlerCollection.doStart(Han= dlerCollection.java:152) > =A0 =A0 =A0 =A0at org.mortbay.component.AbstractLifeCycle.start(AbstractL= ifeCycle.java:50) > =A0 =A0 =A0 =A0at org.mortbay.jetty.handler.HandlerWrapper.doStart(Handle= rWrapper.java:130) > =A0 =A0 =A0 =A0at org.mortbay.jetty.Server.doStart(Server.java:224) > =A0 =A0 =A0 =A0at org.mortbay.component.AbstractLifeCycle.start(AbstractL= ifeCycle.java:50) > =A0 =A0 =A0 =A0at org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty= 6PluginServer.java:132) > =A0 =A0 =A0 =A0at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(A= bstractJettyMojo.java:441) > =A0 =A0 =A0 =A0at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(Abst= ractJettyMojo.java:383) > =A0 =A0 =A0 =A0at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(A= bstractJettyRunMojo.java:210) > =A0 =A0 =A0 =A0at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6Ru= nMojo.java:184) > > > > yes, the message is not easy to read, but it is basically complaining, th= at the > EntityManagerProducer is not having @Dependent scope (since it has > @ApplicationScoped). > > Good night, > Matthias > > On Fri, Mar 5, 2010 at 3:30 PM, Arne Limburg > wrote: >> Hi, >> >> >> >> I have attached my source to EXTCDI-4. >> >> This is how you could use it, how it works and the limitations it has: >> >> >> >> First you have to qualify your EntityManager injection point with the >> provided @PersistenceContext annotation. Then you can use the @Transacti= onal >> annotation. >> >> You will get the same (extended) EntityManager for all beans in the same >> scope and different EntityManagers for beans from other scopes. >> >> >> >> The EntityManagerProducer then checks whether an entity manager for that >> persistence unit and scope exists, creates one if not, and returns the >> entity manager. >> >> >> >> In the current implementation you have to specify the unitName of your >> persistence unit both at the @PersistenceContext annotation and the >> @Transactional annotation. This is very ugly, we should define a sensibl= e >> default behavior here. The advantage is that you can have injected multi= ple >> persistence units within one scope. >> >> >> >> Other potential problems: >> >> I don't know if the detection of the current scope works correctly when = an >> EntityManager is injected in a bean with @Dependent scope or when a >> @Transactional annotation is used on a bean with @Dependent scope >> >> I don't know if the closing of the EntityManager works correct (i.e. if = the >> scope is still active when the EntityManager gets destroyed). Or could w= e >> simply close the EntityManager, if it is open assuming that all beans in >> that scope will be destroyed at the same time? >> >> >> >> What do you think? >> >> >> >> Regards, >> >> Arne >> >> >> >> -- >> >> >> >> Arne Limburg - Enterprise Developer >> >> OpenKnowledge GmbH, Oldenburg >> >> Bismarckstra=DFe 13, 26122 Oldenburg >> >> Mobil: +49 (0) 170 - 2733627 >> >> Tel: +49 (0) 441 - 4082-0 >> >> Fax: +49 (0) 441 - 4082-111 >> >> arne.limburg@openknowledge.de >> >> http://www.openknowledge.de >> >> >> >> Registergericht: Amtsgericht Oldenburg, HRB 4670 >> >> Gesch=E4ftsf=FChrer: Lars R=F6wekamp, Jens Schumann >> >> >> >> Von: Gerhard Petracek [mailto:gerhard.petracek@gmail.com] >> Gesendet: Donnerstag, 4. M=E4rz 2010 20:39 >> An: MyFaces Development >> Betreff: Re: [Ext-CDI] @Transactional >> >> >> >> hi arne, >> >> >> >> i created a jira issue for it [1]. >> >> could you please upload your implementation. >> >> + a short description about the possible usages as well as restrictions = (if >> present). >> >> >> >> thx & regards, >> >> gerhard >> >> >> >> [1] https://issues.apache.org/jira/browse/EXTCDI-4 >> >> http://www.irian.at >> >> Your JSF powerhouse - >> JSF Consulting, Development and >> Courses in English and German >> >> Professional Support for Apache MyFaces >> >> 2010/2/20 Arne Limburg >> >> Hi, >> >> >> >> I've updated my code at >> >> http://wiki.apache.org/myfaces/Extensions/CDI/DevDoc/Drafts/Transactiona= l >> >> It is not really tested and lacks some fallback-scenarios (i.e. >> null-handling, etc.), but it is a starting point to inject scoped >> EntityManagers for every CDI-scope. >> >> >> >> Regards, >> >> Arne >> >> >> >> -- >> >> >> >> Arne Limburg - Enterprise Developer >> >> OpenKnowledge GmbH, Oldenburg >> >> Bismarckstra=DFe 13, 26122 Oldenburg >> >> Mobil: +49 (0) 151 - 108 22 942 >> >> Tel: +49 (0) 441 - 4082-0 >> >> Fax: +49 (0) 441 - 4082-111 >> >> arne.limburg@openknowledge.de >> >> http://www.openknowledge.de >> >> >> >> Registergericht: Amtsgericht Oldenburg, HRB 4670 >> >> Gesch=E4ftsf=FChrer: Lars R=F6wekamp, Jens Schumann >> >> >> >> Von: Gerhard Petracek [mailto:gerhard.petracek@gmail.com] >> >> Gesendet: Montag, 15. Februar 2010 13:44 >> >> An: MyFaces Development >> Betreff: Re: [Ext-CDI] @Transactional >> >> >> >> hi arne, >> >> >> >> thx for providing the source code. >> >> i'll have a look at it after the jsfdays. >> >> >> >> one of the goals is to provide an alternative conversation scope for cdi >> which allows to use the conversation concepts provided by orchestra. >> >> so we have to ensure that it works with every custom cdi scope. >> >> (cdi conversations would be the default scope) >> >> >> >> regards, >> >> gerhard >> >> http://www.irian.at >> >> Your JSF powerhouse - >> JSF Consulting, Development and >> Courses in English and German >> >> Professional Support for Apache MyFaces >> >> 2010/2/15 Arne Limburg >> >> Hi, >> >> I've prototyped some code that injects conversation-scoped EntityManager= s >> reading the unitName from the qualifier annotation and added @Transactio= nal >> support for this EntityManagers. This code needs some thinking though, e= .g. >> how to handle the default-case (no unitName specified)... >> >> If you want to take a look at it, I have created a Wiki page and added m= y >> code as attachment: >> http://wiki.apache.org/myfaces/Extensions/CDI/DevDoc/Drafts/Transactiona= l >> >> This code could be a starting point to implement Orchestra-like >> conversations (starting with CDI-Conversations)... >> >> Regards, >> Arne >> >> -- >> >> Arne Limburg - Enterprise Developer >> OpenKnowledge GmbH, Oldenburg >> Bismarckstra=DFe 13, 26122 Oldenburg >> Mobil: +49 (0) 151 - 108 22 942 >> Tel: +49 (0) 441 - 4082-0 >> Fax: +49 (0) 441 - 4082-111 >> arne.limburg@openknowledge.de >> http://www.openknowledge.de >> >> Registergericht: Amtsgericht Oldenburg, HRB 4670 >> Gesch=E4ftsf=FChrer: Lars R=F6wekamp, Jens Schumann >> >> -----Urspr=FCngliche Nachricht----- >> Von: Mark Struberg [mailto:struberg@yahoo.de] >> >> Gesendet: Samstag, 13. Februar 2010 20:27 >> >> An: MyFaces Development >> Betreff: AW: [Ext-CDI] @Transactional >> >>> I am afraid supporting multiple persistence-units in that >>> scenario is very difficult... >> >> Nope, it's really easy. I simply use Qualifiers to distinguish between t= hem. >> >> @Qualifier >> public @instance Core {} >> >> @Qualifier >> public @instance Other {} >> >> ---- >> @RequestScoped >> public class EMProducer { >> private @PersistenceContext(unitName=3D"core") EntityManager emCore; >> private @PersistenceContext(unitName=3D"other") EntityManager emOther; >> >> >> public @Produces @Core EntityManager getCoreEM() {return emCore;} >> public @Produces @Other EntityManager getOtherEM() {return emOther;} >> >> >> Injection happens with >> >> private @Inject @Core EntityManager >> >> >> Got the idea? >> >> LieGrue, >> strub >> >> --- Arne Limburg schrieb am Sa, 13.2.201= 0: >> >>> Von: Arne Limburg >>> Betreff: AW: [Ext-CDI] @Transactional >>> An: "MyFaces Development" >>> Datum: Samstag, 13. Februar 2010, 20:06 >>> Hi Mark, >>> >>> thank you for your feedback. I was aware of the requirement >>> of CDI-containers to inject JavaEE resources in a >>> JavaEE-environment, but Gerhard and I are thinking about a >>> generic non-JavaEE-solution for EntityManager-injection. And >>> at least weld does no injection of JavaEE-resources in this >>> case. How does OpenWebBeans? >>> I am afraid supporting multiple persistence-units in that >>> scenario is very difficult... >>> >>> Nonetheless it would be nice to see your >>> multiple-database-handling TransactionInterceptor in CODI. >>> >>> Regards, >>> Arne >>> >>> -- >>> >>> Arne Limburg - Enterprise Developer >>> OpenKnowledge GmbH, Oldenburg >>> Bismarckstra=DFe 13, 26122 Oldenburg >>> Mobil: +49 (0) 151 - 108 22 942 >>> Tel: +49 (0) 441 - 4082-0 >>> Fax: +49 (0) 441 - 4082-111 >>> arne.limburg@openknowledge.de >>> http://www.openknowledge.de >> >>> >>> Registergericht: Amtsgericht Oldenburg, HRB 4670 >>> Gesch=E4ftsf=FChrer: Lars R=F6wekamp, Jens Schumann >>> >>> -----Urspr=FCngliche Nachricht----- >>> Von: Mark Struberg [mailto:struberg@yahoo.de] >>> >>> Gesendet: Samstag, 13. Februar 2010 15:39 >>> An: MyFaces Development >>> Betreff: AW: [Ext-CDI] @Transactional >>> >>> Hi! >>> >>> The JSR-299 spec defines that we have to support injection >>> of EE-Resources. >>> >>> This was more explicit in the old version of the spec, but >>> unless the wording got shortened, I still think injection of >>> @PersistenceUnit and @PersistenceContext must be supported >>> by any JSR-299 container (at least in an EE environment). >>> >>> For OpenWebBeans, you can simply use our >>> openwebbeans-resource plugin. Please note that this is >>> necessary because OWB is modular, and openwebbeans-impl (the >>> core) will have no EE dependencies at all (not even JSF, >>> JPA, etc!) This will get picked up automatically if it is >>> available in the classpath, e.g. you can simply define the >>> following maven dependency: >>> >>> =A0 =A0 =A0 =A0 >>> >>> org.apache.openwebbeans >>> >>> openwebbeans-resource >>> >>> ${owb.version} >>> =A0 =A0 =A0 =A0 >>> >>> OWB supports 2 different scenarios. If you are not running >>> in a JTA aware container like e.g. OpenEJB, you will >>> automatically use a simple resource version of an SPI >>> implementation which uses >>> Persistence#createEntityManagerFactory(unitName) for >>> injecting (Thus getting an extended EM). If you use e.g. >>> OpenEJB, we are able to get the injectable resources >>> directly from there (thus getting a transactional EM). >>> >>> Once this is available, you can simply create a producer >>> method for the EntityManager: >>> >>> https://svn.apache.org/repos/asf/openwebbeans/trunk/samples/reservation= /src/main/java/org/apache/webbeans/reservation/util/EntityManagerUtil.java >> >>> >>> There is also an example on how to implement a >>> TransactionalInterceptor: >>> >>> https://svn.apache.org/repos/asf/openwebbeans/trunk/samples/reservation= /src/main/java/org/apache/webbeans/reservation/intercept/TransactionalInter= ceptor.java >> >>> >>> In my company, I already implemented a >>> TransactionalInteceptor which is capable of handling >>> multiple databases at a time and also correctly handles >>> nested transactions. I hope to migrate this over to CODI in >>> the near future. >>> >>> >>> LieGrue, >>> strub >>> >>> >>> --- Arne Limburg >>> schrieb am Sa, 13.2.2010: >>> >>> > Von: Arne Limburg >>> > Betreff: AW: [Ext-CDI] @Transactional >>> > An: "'MyFaces Development'" >>> > Datum: Samstag, 13. Februar 2010, 14:42 >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > Hi Gerhard, >>> > >>> > >>> > >>> > OK, I got what you did, >>> > basically I did the same. You are right, >>> > that was pretty straight-forward, but I had to >>> hard-code >>> > the persistence-unit >>> > name. >>> > >>> > >>> > >>> > I have two ideas to inject the >>> > persistence-unit name into the >>> > producer-method for the EntityManager: >>> > >>> > >>> > >>> > First idea: A >>> > @PersistenceUnitName qualifier-annotation to >>> > inject the name into the producer-method. Client code >>> would >>> > have somethink like >>> > >>> > public class Configuration >>> > { >>> > >>> > >>> > >>> > =A0 @Produces >>> > @PersistenceUnitName >>> > >>> > =A0 String >>> > getPersistenceUnitName() { >>> > >>> > ... >>> > >>> > Not really nice, but the >>> > simplest solution to generify it. >>> > >>> > >>> > >>> > Second idea: >>> > >>> > The @PersistenceContext >>> > qualifier has a @Nonbind attribute >>> > persistenceUnitName which we can extract in the >>> producer >>> > method. But then we >>> > get in scoping issues. Especially when having >>> multiple >>> > persistence-units within >>> > one deployment. The second problem is: How can the >>> > @Transactional annotation >>> > know the persistence-unit-name. >>> > >>> > >>> > >>> > Any other ideas? >>> > >>> > >>> > >>> > Regards, >>> > >>> > Arne >>> > >>> > >>> > >>> > -- >>> > >>> > >>> > >>> > Arne Limburg - Enterprise >>> > Developer >>> > >>> > OpenKnowledge GmbH, >>> > Oldenburg >>> > >>> > Bismarckstra=DFe 13, 26122 >>> > Oldenburg >>> > >>> > Mobil: +49 (0) 151 - 108 22 >>> > 942 >>> > >>> > Tel: +49 (0) 441 - >>> > 4082-0 >>> > >>> > Fax: +49 (0) 441 - >>> > 4082-111 >>> > >>> > arne.limburg@openknowledge.de >>> > >>> > >>> > http://www.openknowledge.de >> >>> > >>> > >>> > >>> > >>> > Registergericht: Amtsgericht >>> > Oldenburg, HRB 4670 >>> > >>> > Gesch=E4ftsf=FChrer: Lars >>> > R=F6wekamp, Jens Schumann >>> > >>> > >>> > >>> > >>> > >>> > Von: Gerhard Petracek >>> > [mailto:gerhard.petracek@gmail.com] >>> >>> > >>> > Gesendet: Samstag, 13. Februar 2010 14:32 >>> > >>> > An: MyFaces Development >>> > >>> > Betreff: Re: [Ext-CDI] @Transactional >>> > >>> > >>> > >>> > >>> > >>> > hi arne, >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > i used the EntityManager to get >>> > an EntityTransaction. >>> > >>> > >>> > >>> > >>> > >>> > you have to use cdi to create and >>> > inject it. >>> > >>> > >>> > >>> > >>> > >>> > (i used some producer methods.) >>> > >>> > >>> > >>> > >>> > >>> > i created @PersistenceUnit which >>> > is a cdi qualifier and >>> > >>> > >>> > >>> > >>> > >>> > @Transactional which is a cdi >>> > interceptor binding. >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > basically it works and it isn't >>> > hard to use. >>> > >>> > >>> > >>> > >>> > >>> > however, we have to think about an >>> > approach to provide as >>> > much as possible in a generic way. >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > regards, >>> > >>> > >>> > >>> > >>> > >>> > gerhard >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > http://www.irian.at >> >>> > >>> > >>> > >>> > Your JSF powerhouse - >>> > >>> > JSF Consulting, Development and >>> > >>> > Courses in English and German >>> > >>> > >>> > >>> > Professional Support for Apache MyFaces >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > 2010/2/13 Arne Limburg >>> > >>> > >>> > >>> > >>> > >>> > >>> > Hi >>> > Gerhard, >>> > >>> > >>> > >>> > Did >>> > you mean "i used >>> > UserTransaction"? If not, how do you receive your >>> > EntityTransaction? >>> > >>> > >>> > >>> > I am >>> > working on a solution to >>> > get request-scoped EntityManagers injected within a >>> > servlet-container that does >>> > not even support the web-profile (which are the >>> current >>> > jetty and the current >>> > tomcat). I am not able to get an EntityManager >>> injected via >>> > @PersistenceContext >>> > in that environment. So it would be nice if there were >>> some >>> > CDI-Extension to >>> > achieve this. The implementation would be pretty >>> > straight-forward except the >>> > configuration of the persistence-unit name and the >>> handling >>> > of different >>> > persistence-units within one CDI-deployment >>> > unit. >>> > >>> > >>> > >>> > Using >>> > JTA-Transactions vs. >>> > resource-local EntityTransactions is another issue >>> > here. >>> > >>> > >>> > >>> > >>> > >>> > Regards, >>> > >>> > Arne >>> > >>> > >>> > >>> > -- >>> > >>> > >>> > >>> > Arne >>> > Limburg - Enterprise >>> > Developer >>> > >>> > OpenKnowledge GmbH, >>> > Oldenburg >>> > >>> > Bismarckstra=DFe >>> > 13, 26122 Oldenburg >>> > >>> > Mobil: +49 (0) 151 >>> > - 108 22 942 >>> > >>> > Tel: +49 (0) 441 - >>> > 4082-0 >>> > >>> > Fax: +49 (0) 441 - >>> > 4082-111 >>> > >>> > arne.limburg@openknowledge.de >>> > >>> > >>> > http://www.openknowledge.de >>> > >>> > >>> > >>> > Registergericht: >>> > Amtsgericht Oldenburg, >>> > HRB 4670 >>> > >>> > Gesch=E4ftsf=FChrer: >>> > Lars R=F6wekamp, Jens >>> > Schumann >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > Von: Gerhard >>> > Petracek [mailto:gerhard.petracek@gmail.com] >>> > >>> > >>> > Gesendet: Freitag, 12. Februar 2010 19:59 >>> > >>> > An: MyFaces Development >>> > >>> > Betreff: Re: [Ext-CDI] @Transactional >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > hi >>> > arne, >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > yes >>> > - i used EntityTransaction in the prototype and it >>> works >>> > pretty well in a >>> > servlet container (that was the base idea). >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > regards, >>> > >>> > >>> > >>> > >>> > >>> > gerhard >>> > >>> > >>> > >>> > http://www.irian.at >> >>> > >>> > >>> > >>> > Your JSF powerhouse - >>> > >>> > JSF Consulting, Development and >>> > >>> > Courses in English and German >>> > >>> > >>> > >>> > Professional Support for Apache MyFaces >>> > >>> > >>> > >>> > 2010/2/12 >>> > Arne Limburg >>> > >>> > >>> > >>> > >>> > >>> > >>> > Hi >>> > folks, >>> > >>> > >>> > >>> > I saw the discussion of adding an >>> > @Transactional-Annotation to your >>> > CDI extensions. I think Gerhard wrote it. I wonder if >>> it >>> > deals with JTA >>> > transactions (which indeed would be pretty >>> > straight-forward) or with >>> > EntityTransactions of an resource-local EntityManager. >>> I am >>> > working on the >>> > latter one and just would want to know if someone else >>> is >>> > working on such >>> > stuff. I think it would be great, when we could >>> archive >>> > injection of >>> > resource-local EntityManagers with transaction-support >>> to >>> > deploy it on a tomcat >>> > or jetty. What do you think? >>> > >>> > >>> > >>> > Regards, >>> > >>> > Arne >>> > >>> > >>> > >>> > -- >>> > >>> > >>> > >>> > Arne Limburg - Enterprise >>> > Developer >>> > >>> > OpenKnowledge GmbH, Oldenburg >>> > >>> > Bismarckstra=DFe >>> > 13, 26122 Oldenburg >>> > >>> > Mobil: >>> > +49 (0) 151 - 108 22 942 >>> > >>> > Tel: >>> > +49 (0) 441 - 4082-0 >>> > >>> > Fax: >>> > +49 (0) 441 - 4082-111 >>> > >>> > arne.limburg@openknowledge.de >>> > >>> > >>> > http://www.openknowledge.de >> >>> > >>> > >>> > >>> > >>> > Registergericht: >>> > Amtsgericht Oldenburg, HRB 4670 >>> > >>> > Gesch=E4ftsf=FChrer: >>> > Lars R=F6wekamp, Jens Schumann >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> >>> >>> __________________________________________________ >>> Do You Yahoo!? >>> Sie sind Spam leid? Yahoo! Mail verf=FCgt =FCber einen >>> herausragenden Schutz gegen Massenmails. >>> http://mail.yahoo.com >>> >> >> __________________________________________________ >> Do You Yahoo!? >> Sie sind Spam leid? Yahoo! Mail verf=FCgt =FCber einen herausragenden Sc= hutz >> gegen Massenmails. >> http://mail.yahoo.com >> >> >> >> > > > > -- > Matthias Wessendorf > > blog: http://matthiaswessendorf.wordpress.com/ > sessions: http://www.slideshare.net/mwessendorf > twitter: http://twitter.com/mwessendorf > --=20 Matthias Wessendorf blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf twitter: http://twitter.com/mwessendorf