You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by garethahealy <ga...@gmail.com> on 2014/11/26 12:41:57 UTC

XA Database and aries.xa.aware

I have been playing around with some database code [1], and randomly on my
google travels spotted [2]. So i am trying to understand when/why i should
use: aries.xa.aware=true

>From my current setup, i believe i am using XA connections, so what benefit
is there in adding the aries.xa.aware into the mix? It seems to just
duplicate what i am currently doing...

[1]https://github.com/garethahealy/jboss-fuse-examples/blob/master/database-playground/database-datasource/src/main/resources/OSGI-INF/blueprint/database-datasource-context.xml

[2]https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.0/html/EIP_Transaction_Guide/files/XaJdbc-AutoEnlist.html





--
View this message in context: http://karaf.922171.n3.nabble.com/XA-Database-and-aries-xa-aware-tp4036692.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: XA Database and aries.xa.aware

Posted by Charlie Mordant <cm...@gmail.com>.
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é <jb...@nanthrax.net>:

> 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
>> <cm...@gmail.com>:
>>
>>     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
>>     <krzys.sobkowiak@gmail.com <ma...@gmail.com>>:
>>
>>         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
>>>         <garethahealy@gmail.com <ma...@gmail.com>>:
>>>
>>>             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é
> jbonofre@apache.org
> 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

Re: XA Database and aries.xa.aware

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
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
> <cm...@gmail.com>:
>
>     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
>     <krzys.sobkowiak@gmail.com <ma...@gmail.com>>:
>
>         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
>>         <garethahealy@gmail.com <ma...@gmail.com>>:
>>
>>             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é
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: XA Database and aries.xa.aware

Posted by Benjamin Graf <be...@gmx.net>.
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 <cm...@gmail.com>:
>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
><kr...@gmail.com>:
>
>>  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"
>> 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"
>> 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 <ga...@gmail.com>:
>>
>>> 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.

Re: XA Database and aries.xa.aware

Posted by Charlie Mordant <cm...@gmail.com>.
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 <kr...@gmail.com>:

>  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"
> 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"
> 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 <ga...@gmail.com>:
>
>> 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

Re: XA Database and aries.xa.aware

Posted by Sobkowiak Krzysztof <kr...@gmail.com>.
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 <garethahealy@gmail.com
> <ma...@gmail.com>>:
>
>     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


Re: XA Database and aries.xa.aware

Posted by Charlie Mordant <cm...@gmail.com>.
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"
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"
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 <ga...@gmail.com>:

> 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

Re: XA Database and aries.xa.aware

Posted by garethahealy <ga...@gmail.com>.
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.

Re: XA Database and aries.xa.aware

Posted by Charlie Mordant <cm...@gmail.com>.
Hi,


Using aries.xa.aware ensures that your transaction is handled by Aries
(Auto enlisted) so you’ll be able to mix multi-databases transactions,
mixed JMS/JDBC ones.

2014-11-26 12:41 GMT+01:00 garethahealy <ga...@gmail.com>:

> I have been playing around with some database code [1], and randomly on my
> google travels spotted [2]. So i am trying to understand when/why i should
> use: aries.xa.aware=true
>
> From my current setup, i believe i am using XA connections, so what benefit
> is there in adding the aries.xa.aware into the mix? It seems to just
> duplicate what i am currently doing...
>
> [1]
> https://github.com/garethahealy/jboss-fuse-examples/blob/master/database-playground/database-datasource/src/main/resources/OSGI-INF/blueprint/database-datasource-context.xml
>
> [2]
> https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.0/html/EIP_Transaction_Guide/files/XaJdbc-AutoEnlist.html
>
>
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/XA-Database-and-aries-xa-aware-tp4036692.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

Re: XA Database and aries.xa.aware

Posted by Charlie Mordant <cm...@gmail.com>.
Hi,

Using aries.xa.aware ensures that your transaction is handled by Aries (Auto enlisted) so you’ll be able to mix multi-databases transactions, mixed JMS/JDBC ones.


  
> Le 26 nov. 2014 à 12:41, garethahealy <ga...@gmail.com> a écrit :
> 
> I have been playing around with some database code [1], and randomly on my
> google travels spotted [2]. So i am trying to understand when/why i should
> use: aries.xa.aware=true
> 
> From my current setup, i believe i am using XA connections, so what benefit
> is there in adding the aries.xa.aware into the mix? It seems to just
> duplicate what i am currently doing...
> 
> [1]https://github.com/garethahealy/jboss-fuse-examples/blob/master/database-playground/database-datasource/src/main/resources/OSGI-INF/blueprint/database-datasource-context.xml
> 
> [2]https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.0/html/EIP_Transaction_Guide/files/XaJdbc-AutoEnlist.html
> 
> 
> 
> 
> 
> --
> View this message in context: http://karaf.922171.n3.nabble.com/XA-Database-and-aries-xa-aware-tp4036692.html
> Sent from the Karaf - User mailing list archive at Nabble.com.