Hi, I made an example Using Pax-JDBC/Aries TM
* The 'Database' feature: https://github.com/OsgiliathEnterprise/net.osgiliath.parent/blob/master/net.osgiliath.framework/net.osgiliath.features.karaf-features/net.osgiliath.features.karaf-features-derby/src/main/resources/net.osgiliath.features.karaf-features-derby.xml * The Pax-JDBC config file to automatically create db: https://github.com/OsgiliathEnterprise/net.osgiliath.parent/blob/master/net.osgiliath.framework/net.osgiliath.features.karaf-features/net.osgiliath.features.karaf-features.itests/net.osgiliath.features.karaf-features.itests.feature/src/main/resources/net.osgiliath.features.karaf-features.itests.feature.database.cfg * A custom JDBC extender (using Derby client, you can use pre baked one provided by pax-jdbc): https://github.com/OsgiliathEnterprise/net.osgiliath.parent/tree/master/net.osgiliath.framework/net.osgiliath.helpers.parent/net.osgiliath.helpers.derby * A JPA module consuming this db: https://github.com/OsgiliathEnterprise/net.osgiliath.parent/tree/master/net.osgiliath.framework/net.osgiliath.features.karaf-features/net.osgiliath.features.karaf-features.itests/net.osgiliath.features.karaf-features.itests.jpa * The feature to test: https://github.com/OsgiliathEnterprise/net.osgiliath.parent/blob/master/net.osgiliath.framework/net.osgiliath.features.karaf-features/net.osgiliath.features.karaf-features.itests/net.osgiliath.features.karaf-features.itests.feature/src/main/resources/net.osgiliath.features.karaf-features.itests.feature.xml Regards, 2014-11-27 19:00 GMT+01:00 Jean-Baptiste Onofré <[email protected]>: > Hi, > > Agree with Benjamin. > > Anyway, we should add it in the enterprise section of the Karaf user guide. > > Regards > JB > > On 11/27/2014 06:49 PM, Benjamin Graf wrote: > >> Hi all together, >> >> forget about the docs available. A lot of stuff has been added to aries >> transaction jdbc in the last months. I suggest to look on the code >> itself or usuage of pax-jdbc-config and pax-jdbx-pool-aries. There is a >> bit of docs on the pax wiki as far as I remember. >> >> Regards Benjamin >> >> Am 27. November 2014 17:54:43 MEZ, schrieb Charlie Mordant >> <[email protected]>: >> >> Hi Krysztof, >> >> In the fuse documentation >> (https://access.redhat.com/documentation/en-US/Red_Hat_ >> JBoss_Fuse/6.0/html/EIP_Transaction_Guide/files/XaJdbc-DataSources.html), >> but unfortunately not in the Aries one... >> Concerning the Aries datasource wrapper, I crawled the mailing lists >> to find its purpose... >> >> Regards >> >> 2014-11-27 17:08 GMT+01:00 Sobkowiak Krzysztof >> <[email protected] <mailto:[email protected]>>: >> >> Hi Charlie >> >> Where is that all documented? >> >> Regards >> Krzysztof >> >> >> On 27.11.2014 15:34, Charlie Mordant wrote: >> >>> Hi, >>> Sorry for the doubled mail (some issues with my client). >>> >>> As long as you don't use the transaction manager (i.e use a >>> single resource in a transaction), I think that it's ok (from >>> what I understand, but I may be wrong). >>> >>> However, auto enlistement is quite easy to achieve: >>> You just have to include >>> org.apache.aries.transaction/org.apache.aries.transaction.jdbc >>> dependency, then export your XADatasource service adding some >>> properties: >>> <service ref="dataSource" interface="javax.sql.XADataSource"> >>> <service-properties> >>> <entry key="osgi.jndi.service.name >>> <http://osgi.jndi.service.name>" >>> value="jdbc/${project.parent.artifactId}.database.xa" /> >>> <entry key="aries.xa.username" value="APP"/> >>> <entry key="aries.xa.password" value="APP"/> >>> <entry key="aries.xa.transaction" value="xa"/> >>> <entry key="aries.xa.name <http://aries.xa.name>" >>> value="${project.parent.artifactId}.database.xa"/> >>> </service-properties> >>> </service> >>> >>> It's pretty nothing to do and that ensures that your app could >>> handle multiple resources in the future (and many lost hours >>> searching for the cause). >>> >>> Regards >>> >>> 2014-11-27 13:06 GMT+01:00 garethahealy >>> <[email protected] <mailto:[email protected]>>: >>> >>> So from what you've said, if i am not mixing transactions >>> across components, >>> then i wouldn't need to use the aries auto enlisted feature. >>> >>> i.e.: my setup is purely DB transactions, so its not needed. >>> >>> >>> >>> -- >>> View this message in context: >>> http://karaf.922171.n3.nabble.com/XA-Database-and-aries-xa- >>> aware-tp4036692p4036725.html >>> Sent from the Karaf - User mailing list archive at >>> Nabble.com. >>> >>> >>> >>> >>> -- >>> Charlie Mordant >>> >>> Full OSGI/EE stack made with Karaf: >>> https://github.com/OsgiliathEnterprise/net.osgiliath.parent >>> >> >> >> >> >> -- >> Charlie Mordant >> >> Full OSGI/EE stack made with Karaf: >> https://github.com/OsgiliathEnterprise/net.osgiliath.parent >> >> >> -- >> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail >> gesendet. >> > > -- > Jean-Baptiste Onofré > [email protected] > http://blog.nanthrax.net > Talend - http://www.talend.com > -- Charlie Mordant Full OSGI/EE stack made with Karaf: https://github.com/OsgiliathEnterprise/net.osgiliath.parent
