Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 94622 invoked from network); 9 Aug 2007 15:09:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Aug 2007 15:09:10 -0000 Received: (qmail 87019 invoked by uid 500); 9 Aug 2007 15:09:02 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 86972 invoked by uid 500); 9 Aug 2007 15:09:02 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 86946 invoked by uid 99); 9 Aug 2007 15:09:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Aug 2007 08:09:02 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [69.147.95.67] (HELO smtp104.plus.mail.sp1.yahoo.com) (69.147.95.67) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 09 Aug 2007 15:08:51 +0000 Received: (qmail 3180 invoked from network); 9 Aug 2007 15:08:30 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-YMail-OSG:Mime-Version:In-Reply-To:References:Content-Type:Message-Id:Content-Transfer-Encoding:From:Subject:Date:To:X-Mailer; b=EnXs1lR9giL6hemkasqpzSgFOmZcEKYnGzIxwMk5ab/sqEnpnTpMJ/TchGgmdjtC5B8Y0DunH7R50LhHPJNUKXdo5nuWhkQKFfu6kJ3ZLF7hvuBrrbj/UBe7vqonoBGtpR5Id3fSxSdSGpXy1uxNOI6SSUswPp2spTvSiGI3Sfs= ; Received: from unknown (HELO ?192.168.1.108?) (david_jencks@67.102.173.8 with plain) by smtp104.plus.mail.sp1.yahoo.com with SMTP; 9 Aug 2007 15:08:29 -0000 X-YMail-OSG: hyOB3eAVM1mt8cUXa3XCZ_MShr9YQtdOpQ.Qj1ZnXQnHtIz2WfC8GfIsx0jhpDS3Jv.et7.gprFRTatb686UHX5zGM01t7AeFW__luBnPPDTyLXdyg-- Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <12069028.post@talk.nabble.com> References: <12067391.post@talk.nabble.com> <114D3418-D674-4EB4-A284-CA3DC99A89DB@yahoo.com> <12069028.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable From: David Jencks Subject: Re: geronimo using JPOX JDO Date: Thu, 9 Aug 2007 08:08:37 -0700 To: user@geronimo.apache.org X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org I think that something like @Resource(name=3D"tamsDS) @Resource(name=3D"tamsDS2) public class MyFoo { ... should work. I think we need an integration test demonstrating how =20 to set this up. thanks david jencks On Aug 9, 2007, at 2:11 AM, fred.ac wrote: > > Thanks for your quick reply! > I have a session bean with jpox persitence manager factory injected =20= > like > this : > > @Stateless(name =3D "hello") > @TransactionManagement(TransactionManagementType.CONTAINER) > public class StatelessSessionBean implements StatelessSession { > > @Resource(name =3D "jpox") > private PersistenceManagerFactory pmf; > > @TransactionAttribute(TransactionAttributeType.REQUIRED) > public String sayHello(String name) { > String fctrName =3D "?"; > try { > PersistenceManager pm =3D pmf.getPersistenceManager(); > Query q =3D pm.newQuery(Functionality.class, "name =3D=3D =20= > 'test2'"); > q.setUnique(true); > Functionality fct =3D (Functionality) q.execute(); > FunctionalityRelease fctr =3D > fct.getFunctionalityRelease("00.00.01"); > q.closeAll(); > pm.close(); > fctrName =3D fctr.getName(); > } catch (Exception ex) { > ex.printStackTrace(); > } > return fctrName; > } > } > > You said "try providing resource-refs in each component that uses =20 > jdo (web > app or ejb session bean) to each of the datasources" > How can I define resource-refs you mentioned ? in ejb-jar.xml, > open-ejb-jar.xml ? Could you give me an example ? > > Thanks > > Fred. > > > djencks wrote: >> >> >> On Aug 8, 2007, at 11:56 PM, fred.ac wrote: >> >>> >>> I'm trying to use JPOX framework (www.jpox.org) with geronimo 2-M6. >>> I have a test case (all packaged in a ear) that is working with >>> JBOSS 4.2 >>> and I want ot make it working with geronimo. >>> >>> First problem: in the rar file provided in jpox distrib the ra.xml >>> doesn't >>> contain available properties (config-property elements are empty). >>> With >>> Jboss I defined all properties in a jpox-ds.xml file : >>> >>> >>> >>> >>> eis/jdo/JpoxPersistenceManagerFactory >>> MyApplication.ear#jpox-jca-1.2-SNAPSHOT.rar>> name> >>> >>> javax.resource.cci.ConnectionFactory>> connection-definition> >>> >>> >> type=3D"java.lang.String">java:/tamsDS >>> >> type=3D"java.lang.String">java:/tamsDS2 >>> ... >>> >>> >>> >>> With geronimo I defined the properties in a jpox.xml file like this: >>> >> connector-1.1"> >>> >> xmlns:dep=3D"http://geronimo.apache.org/xml/ns/deployment-1.1"> >>> >>> console.dbpool >>> jpox >>> 1.0 >>> rar >>> >>> >>> >>> oracle >>> ojdbc14 >>> 10.2.0.1.0 >>> jar >>> >>> >>> >>> >>> >>> >>> >>> >>> javax.resource.cci.ConnectionFactory>> connectionfactory-interface> >>> >>> jpox >>> >>> >> name=3D"ConnectionDriverName">oracle.jdbc.OracleDriver>> property-setting> >>> >> name=3D"ConnectionURL">jdbc:oracle:thin:@localhost:1521/XE>> property-setting> >>> >> name=3D"ConnectionUserName">sa >>> >> name=3D"ConnectionPassword">hagar >>> >> name=3D"Schema">SA >>> >> name=3D"FixedDatastore">true >>> >> name=3D"ValidateTables">false >>> >> name=3D"ValidateConstraints">false >>> >> name=3D"Optimistic">true >>> >> name=3D"Multithreaded">true >>> >> name=3D"IgnoreCache">true >>> >> name=3D"RestoreValues">true >>> >> name=3D"DetachAllOnCommit">true >>> >> name=3D"NontransactionalRead">false >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> the jpox.xml file is referred in geronimo-application like this : >>> >>> jpox-jca-1.2-SNAPSHOT.rar >>> META-INF/jpox.xml >>> >>> >>> Whe I deploy my ear file in geronimo I receive : >>> Unable to deploy: org.apache.geronimo.common.DeploymentException: >>> The plan >>> is trying to set attributes: [ConnectionDriverName, ConnectionURL, >>> ConnectionUserName, ConnectionPassword, Schema, FixedDatastore, >>> ValidateTables, ValidateConstraints, Optimistic, Multithreaded, >>> IgnoreCache, >>> RestoreValues, DetachAllOnCommit, NontransactionalRead] >>> >>> I think it is because these properties are not define in the ra.xml >>> provided >>> by jpox. If I manually add them it works. >>> >>> Is it possible to define properties somewhere else ? I don't want >>> to "patch" >>> standard jpox distrib (jpox-jca-1.2-SNAPSHOT.rar) to make it >>> working with >>> geronimo. >> >> I think you will need to patch the rar or build your own with all the >> properties in the ra.xml. My understanding of the j2ca spec is that >> this is required of the ra.xml. If the jpox people think otherwise >> I'd like to know why. >>> >>> My second problem: I want that jpox use a geronimo connection pool. >>> I have >>> created 2 connection pools via the geronimo console. I need a >>> transactional >>> one and a non-transactional one, how can I specify this ?. Jpox >>> needs 2 >>> properties to use app server connection pool : ConnectionFactoryName >>> (transactional) and ConnectionFactory2Name (non transactional). As >>> you see >>> in the jpox-ds.xml the connections are refered with a global jndi =20= >>> name >>> (java:/tamsDS and java:/tamsDS2). How can I refer this in geronimo ? >>> >>> following config doesn't work : >>> >>> >> name=3D"ConnectionFactoryName">java:/tamsDS >>> >> name=3D"ConnectionFactory2Name">java:/tamsDS2>> setting> >>> >>> Pools created in geronimo are defined like this : >>> console.dbpool/tamsDS/1.0/rar >>> console.dbpool/tamsDS2/1.0/rar >>> >>> How can I make the link between them ? >> >> This is trickier. This seems to me like one thing the jpa spec did >> better than the jdo spec. Anyway, I would try providing resource- >> refs in each component that uses jdo (web app or ejb session bean) to >> each of the datasources and using something like >> >> > name=3D"ConnectionFactoryName">java:comp/env/tamsDS> setting> >> > name=3D"ConnectionFactory2Name">java:comp/env/tamsDS2> setting> >> >> Another thing to be aware of is that your application needs to have >> both datasource in parent configurations. So the geronimo plan would >> start something like >> >> > connector-1.1"> >> > xmlns:dep=3D"http://geronimo.apache.org/xml/ns/deployment-1.1"> >> >> console.dbpool >> jpox >> 1.0 >> rar >> >> >> >> console.dbpool >> tamDS >> 1.0 >> rar >> >> >> console.dbpool >> tamDS2 >> 1.0 >> rar >> >> >> >> >> I'd also advise combining the 2 datasource plans into one plan. Be >> sure the non-transactional datasource really is configured with > transaction/> >> >> As long as you name the datasources tamDS and tamDS2 in their plans I >> think geronimo will be able to look up the datasource correctly. >> >> Does jpox recommend the setting? >> >> Please let us know how this works out. If you still have problems >> and have a sample app to demonstrate the problems I can take a look >> at it. I wonder if we should look into supporting jdo similarly to >> how jpa is supported. >> >> thanks >> david jencks >> >> >>> >>> Thanks >>> >>> Fr=E9d=E9ric. >>> --=20 >>> View this message in context: http://www.nabble.com/geronimo-using- >>> JPOX-JDO-tf4240920s134.html#a12067391 >>> Sent from the Apache Geronimo - Users mailing list archive at >>> Nabble.com. >>> >> >> >> > > --=20 > View this message in context: http://www.nabble.com/geronimo-using-=20 > JPOX-JDO-tf4240920s134.html#a12069028 > Sent from the Apache Geronimo - Users mailing list archive at =20 > Nabble.com. >