1 Reply Latest reply on Feb 21, 2002 2:02 PM by davidjencks

    How to Configure Application managed DataSource

    asitkp

      I am a new user of JBoss2.4.4.I am trying to use Application
      authenticated datasource in my Application.

      The entry in my ejb-jar.xml file is like this

      <resource-ref>
      NID database
      <res-ref-name>jdbc/NidDB</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Application</res-auth>
      </resource-ref>

      the entry in my jboss.xml file is like this

      <?xml version="1.0" encoding="UTF-8"?>

      <!-- All bean containers use this security manager by default -->
      <security-domain>java:/jaas/NID</security-domain>
      <enterprise-beans>

      <ejb-name>CarrierEntityBean</ejb-name>
      <jndi-name>orillion/carrier</jndi-name>

      <resource-ref>
      <res-ref-name>jdbc/NidDB</res-ref-name>
      <resource-name>NID</resource-name>
      </resource-ref>

      </enterprise-beans>

      <resource-managers>
      <resource-manager res-class="org.jboss.jdbc.XADataSourceLoader">
      <res-name>NID</res-name>
      <res-jndi-name>java:/NID</res-jndi-name>
      </resource-manager>
      </resource-managers>


      The corresponding entry for NID Pool in jboss.jcml file is


      NID
      org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl


      jdbc:oracle:thin:@192.168.0.185:1521:test3


      1200000
      10
      false
      false
      false
      true
      120000
      1800000
      false
      false
      1.0
      0


      As i am using the Application authenticated resource in my application i
      did not give the JDBCUser and Password attribute while configuring the
      NID connection Pool.

      But when I am trying to start the Jboss Server ,the Server hangs up
      while trying to create the connection pool.

      Can you please help me out and say how do i configure and use
      Application authenticated datasource in JBoss Application Server.

      Thanks

      Asit

        • 1. Re: How to Configure Application managed DataSource
          davidjencks

          I'm not sure how well this is supported on 2.4.x. You need to supply a user and password so the XADataSourceLoader can check that it can get a connection when it starts (or you can comment out the line in which it does this).

          After that, you can get connections using ds.getConnection(user, pw);. What I don't know is how well connections with different users are distinguished by the pool. There are settings in the pool that tell it something about what to pay attention to, but I'm not sure where they are set or to what.