Matt Hogstrom pisze:
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>*j**dbc/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>
I guess that it's part of geronimo-application.xml and I needn't use
DatabasePool deployment plan insofar I put deps to pgres driver in
preceding XML
Tomasz Mazan vel. Beniamin