11 Replies Latest reply on Apr 12, 2007 12:01 PM by Alex Savitsky

    JBoss Tx on Tomcat - how to configure DataSource?

    Alex Savitsky Novice

      Hi,

      I'm currently researching the possibility to use JBoss Transactions with our Tomcat apps. I've already figured it out with the UserTransaction lookup (a custom ObjectFactory implementation returning com.arjuna.ats.jta.UserTransaction.userTransaction()), but I'm stuck at the datasource configuration, and would appreciate any help offered.

      The usual DataSource declaration in Tomcat's server.xml (or META-INF/context.xml) looks like that:

      <Resource name="DataSource" auth="Container" type="javax.sql.DataSource" username="username"
       password="password" driverClassName="oracle.jdbc.driver.OracleDriver" url="dburl" />
      


      Typically, JTA setup involves specifying a factory class that would return JTA-aware data sources specific to the JTA provider used (it works that way, say, in JOTM and Atomikos). However, I couldn't find any mention of such factory in JBoss Tx, not any means to create a JTA-aware DS. The Programmer's Guide mentions the TransactionalDriver, which wraps the regular JDBC driver, to make it transaction-aware... is this something that should be used in Tomcat setup? Do I simply put the TransactionalDriver class as the driverClassName property, adding ":arjuna" to the JDBC URL? How would I configure it to use Oracle's driver underneath, then? Or did I completely misunderstood this part, and it's configured in some entirely different way?

      Thanks in advance,

      Alex