JCA / Datasources in domain.xml
jesper.pedersen Jul 6, 2010 3:47 PMWe need to include support for datasource and resource adapter deployments in the domain.xml definition.
There are a couple of areas that should be supported:
- Deployment of a datasource
- Deployment of a resource adapter archive
Datasources
The best solution is to have a type safe definition of the resource adapter archives and datasources. This will provide the best tooling support and up-front validation.
Using the existing jboss-ds_6_0.dtd as a starting point and removing deprecated and unused elements we are looking at
<datasources xmlns="urn:jboss:datasources:1.0"> <datasource jndi-name="java:/DefaultDS" pool-name="DefaultDS" enabled="true"> <min-pool-size>1</min-pool-size> <max-pool-size>10</max-pool-size> <username>sa</username> <password>sa</password> <connection-url>jdbc:hsqldb:hsql://${jboss.bind.address}:1701</connection-url> <driver-class>org.hsqldb.jdbcDriver</driver-class> <type-mapping>Hypersonic SQL</type-mapping> <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation> ... </datasource> <xa-datasource jndi-name="java:/PostgreSQLXADS" pool-name="PostgreSQLXADS" enabled="true"> ... </xa-datasource> </datasources>
(Full XSD to follow)
Also; we need to include the security elements in domain.xml as the datasources depends on the security-domain functionality. I'll ping Marcus about this thread.
Resource adapters
Ideally it would be best if a resource adapter archive could be deployed without having any additional metadata defined other than the archive itself.
However we need to define the JNDI binding per connection factory somehow - we will extend the jboss-ra.xml file to allow this of course. So a user should be able to define the mapping in domain.xml.
In addition keeping the functionality where a user can select the connection manager to use for the resource adapter with the fallback to the version specified by the transaction support property in ra.xml.
The ConnectionManager comes in three flavors
- NoTx
- LocalTx
- XATx
<connection-factories xmlns="urn:jboss:connection-factories:1.0"> <no-tx-connection-factory jndi-name="java:/MyCF" pool-name="MyCF" enabled="true"> <connection-factory-class-name>org.acme.ra.MyCF</connection-factory-class-name> <resource-adapter-archive>acme.rar</resource-adapter-archive> </no-tx-connection-factory> </connection-factories>
(Full XSD to follow).
The question is really how much information we want to expose in domain.xml, as having all properties of all sub-systems exposed would quite a lot. But that is a question for another thread.