This page last changed on Sep 24, 2011 by alitokmen.

Container support

Here are the configurations that currently support DataSource or Resource configuration:

Container Configuration Resource DataSource Transactional DataSource XA DataSource
Glassfish 3.x o.c.c.c.glassfish.GlassFish3xStandaloneLocalConfiguration
JOnAS 4.x o.c.c.c.jonas.Jonas4xStandaloneLocalConfiguration
JOnAS 5.x o.c.c.c.jonas.Jonas5xStandaloneLocalConfiguration
Oc4J 9.x o.c.c.c.orion.Oc4j9xStandaloneLocalConfiguration
Oc4j 10.x o.c.c.c.orion.Oc4j10xStandaloneLocalConfiguration
Resin 2.x o.c.c.c.resin.Resin2xStandaloneLocalConfiguration
Resin 3.x o.c.c.c.resin.Resin3xStandaloneLocalConfiguration
Tomcat 4.x o.c.c.c.tomcat.Tomcat4xStandaloneLocalConfiguration
Tomcat 5.x o.c.c.c.tomcat.Tomcat5xStandaloneLocalConfiguration
Tomcat 6.x o.c.c.c.tomcat.Tomcat6xStandaloneLocalConfiguration
Tomcat 7.x o.c.c.c.tomcat.Tomcat7xStandaloneLocalConfiguration
WebLogic 8.x o.c.c.c.weblogic.WebLogicStandaloneLocalConfiguration
WebLogic 9.x o.c.c.c.weblogic.WebLogic9xStandaloneLocalConfiguration
WebLogic 10.x o.c.c.c.weblogic.WebLogic10xStandaloneLocalConfiguration
WebLogic 10.3.x o.c.c.c.weblogic.WebLogic10xStandaloneLocalConfiguration

Notes:

DataSource properties

DataSources are added through pipe-delimited configuration properties that starts with cargo.datasource.datasource. Example:

cargo.datasource.datasource1=cargo.datasource.url=jdbc:mydriver:userdb\|cargo.datasource.driver=org.database.Driver\|...
cargo.datasource.datasource2=cargo.datasource.url=jdbc:mydriver:referencedb\|cargo.datasource.driver=org.database.Driver\|...

Here are the properties that are valid for this:

  • Note that c.d means cargo.datasource
  • Note that if you specify a property marked do not set you will get a CargoException.
Property Purpose Valid Values DataSource Transactional DataSource XA DataSource
c.d.jndi the path to this in jndi any jndi path, like jdbc/userds mandatory mandatory mandatory
c.d.driver the implementation class ex. my.Driver mandatory: must implement java.sql.Driver mandatory: must implement java.sql.Driver mandatory: must implement javax.sql.XADataSource
c.d.properties properties to pass to the driver semi-colon delimited string optional optional mandatory
c.d.url url for the java.sql.Driver ex. jdbc:host:port/mydb mandatory mandatory optional
c.d.type Determines the type of the driver defaults to java.sql.Driver, only set if you want to use a javax.sql.XADataSource do not set do not set javax.sql.XADataSource
c.d.transactionsupport what transaction support LOCAL_TRANSACTION or XA_TRANSACTION do not set mandatory unset defaults to only valid option: XA_TRANSACTION
c.d.id used in configuration files to reference this datasource must contain no path-like characters optional optional optional
c.d.username username to connect to the db string optional optional optional
c.d.password password for the username string optional optional optional

Resource properties

Resources are added through pipe-delimited configuration properties that starts with cargo.resource.resource. Example:

cargo.resource.resource1=cargo.resource.name=resource/apple\|cargo.resource.class=org.mycompany.Apple\|...
cargo.resource.resource2=cargo.resource.name=resource/pear\|cargo.resource.driver=org.mycompany.Pear\|...

Here are the properties that are valid for this:

  • Note that c.r means cargo.resource
Property Purpose Valid Values Mandatory?
c.r.name the path to this in jndi any jndi path, like resource/apple mandatory
c.r.type Interface of the object valid interface mandatory
c.r.class the implementation class valid class implementing the interface mandatory
c.r.parameters properties to to populate the class with semi-colon delimited string; must correspond to setters optional

Examples

Users of the Java API can take a look at the following classes as example:

  • DataSourceOnStandaloneConfigurationTest: datasource definition.
  • TransactionEmulationDataSourceOnStandaloneConfigurationTest: datasource definition with transaction emulation.
  • XATransactionDataSourceOnStandaloneConfigurationTest: XA datasource definition.
  • ResourceOnStandaloneConfigurationTest: resource definition, showing for example mailsession.

Users of the Maven2/Maven3 plugin can use the Maven2 Archetype showing datasource support. Please read: Datasource Definition Archetype.

Document generated by Confluence on Dec 03, 2011 14:37