XAOracleDS
true
false
oracle.jdbc.xa.client.OracleXADataSourcejdbc:oracle:thin:@monkeymachine:1521:jboss
jboss
passwordorg.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter
jboss:service=TransactionManager
Then you need to copy this file to your default (or another profile in your JBossAS) deploy folder, tada! you have registered a JNDI registry for the XA Data-source of yours. Now the question is how to use it with Hibernate. Hibernate configuration files are usually something like:
oracle.jdbc.driver.OracleDriver
rms_owner
jdbc:oracle:thin:@localhost:1521:HBTTST
rms_owner
org.hibernate.dialect.Oracle10gDialect
in this hibernate file as you can see, all the variables required to connect to database are specified. However, now that you have created the Datasource you just need to point hibernate configuration file to the new Datasource file, something like:
org.hibernate.dialect.Oracle10gDialect
java:XAOracleDS
now you should be able to use Hibernate and it should be able to connect to your database flawlessly.
Please note that the connection datasource name in hibernate file is java:XAOracleDS and not XAOracleDS.