Tomasz,
Here is a sample derived from DayTrader where we setup XA and non-XA
datasources. I created new RA's for PostgreSQL, but haven't tested
them, that should work but hopefully you can tell me if there are
issues.
You'll need this jar for PostgreSQL 8.2 http://jdbc.postgresql.org/
download/postgresql-8.2-506.jdbc3.jar and need to place it in the
Geronimo repo and place a dependency element in your plan.
You'll also need the rars which you can find at:
http://snapshots.repository.codehaus.org/org/tranql/tranql-connector-
postgresql-xa/8.2-SNAPSHOT/tranql-connector-postgresql-
xa-8.2-20070905.015528-1.rar
http://snapshots.repository.codehaus.org/org/tranql/tranql-connector-
postgresql-local/8.2-SNAPSHOT/tranql-connector-postgresql-
local-8.2-20070905.015528-1.rar
rename these to 8.2-SNAPSHOT and place them in the Geronimo repo.
<ext-module>
<connector>YourDataSource</connector>
<external-path xmlns:dep="http://geronimo.apache.org/xml/ns/
deployment-1.2">
<dep:groupId>org.tranql</dep:groupId>
<dep:artifactId>tranql-connector-postgresql-xa</
dep:artifactId>
<dep:version>8-2.SNAPSHOT</dep:version>
<dep:type>rar</dep:type>
</external-path>
<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/
connector-1.2">
<resourceadapter>
<outbound-resourceadapter>
<connection-definition>
<connectionfactory-
interface>javax.sql.DataSource</connectionfactory-interface>
<connectiondefinition-instance>
<name>jdbc/YourXADataSource</name>
<config-property-setting
name="DatabaseName">YourDatabaseName</config-property-setting>
<config-property-setting
name="Description"></config-property-setting>
<config-property-setting
name="UserName"></config-property-setting>
<config-property-setting
name="Password"></config-property-setting>
<config-property-setting
name="PortNumber"></config-property-setting>
<config-property-setting
name="ServerName"></config-property-setting>
<config-property-setting
name="LoginTimeout"></config-property-setting>
<connectionmanager>
<xa-transaction>
<transaction-caching/>
</xa-transaction>
<single-pool>
<max-size>100</max-size>
<min-size>0</min-size>
<blocking-timeout-
milliseconds>5000</blocking-timeout-milliseconds>
<idle-timeout-minutes>30</idle-
timeout-minutes>
<match-one/>
</single-pool>
</connectionmanager>
</connectiondefinition-instance>
<connectiondefinition-instance>
<name>jdbc/NoTxYourDataSource</name>
<config-property-setting
name="DatabaseName">YourDatabaseName</config-property-setting>
<config-property-setting
name="Description"></config-property-setting>
<config-property-setting
name="UserName"></config-property-setting>
<config-property-setting
name="Password"></config-property-setting>
<config-property-setting
name="PortNumber"></config-property-setting>
<config-property-setting
name="ServerName"></config-property-setting>
<config-property-setting
name="LoginTimeout"></config-property-setting>
<connectionmanager>
<no-transaction/>
<single-pool>
<max-size>10</max-size>
<min-size>0</min-size>
<blocking-timeout-
milliseconds>5000</blocking-timeout-milliseconds>
<idle-timeout-minutes>30</idle-
timeout-minutes>
<match-one/>
</single-pool>
</connectionmanager>
</connectiondefinition-instance>
</connection-definition>
</outbound-resourceadapter>
</resourceadapter>
</connector>
</ext-module>
On Sep 3, 2007, at 6:55 PM, Tomasz Mazan wrote:
Basically yes. Geronimo won't prevent you from using non-xa
datasources and jms connection factories in JTA transactions, but
if anything goes wrong your data may be left in an inconsistent
state.
If you find that xa is too slow there may be ways of using non-xa
jms connection factories as long as the messages are idempotent,
that is sending the same message multiple times has the same
effect as sending it once. I'm not an expert on this but I think
there's periodic discussion on the activemq lists. I would start
with xa everywhere and see if there are problems.
thanks
david jencks
David, I currently try to configure deployment plan to create
XADataSource for my application.
Could you tell me how looks Geronimo-Postgresql deployment plan for
XA ?
TIA
Tomasz Mazan