3 Replies Latest reply on May 7, 2010 11:51 AM by Peter Johnson

    Local-tx-datasource definition and custom

    Ken Barnes Newbie

      Where is the definition for <local-tx-datasource> located and configured and can I create a cusom such that i can control the jndi lookup like

       

      <Test-tx-dataSource>

      <jndi-name></jndi-name>

      <connection></connection>

      ....

      </Test-tx-dataSource>

       

      and have ds-xml files deploy into this

       

      Thanks

        • 1. Re: Local-tx-datasource definition and custom
          Peter Johnson Master

          local-tx-datasource is defined in docs/schema/jboss-ds_5_0.xsd.  There is also one at docs/dtd/jboss-ds_5_0.dtd, but I think the XSD is used. (This is for JBoss AS 5.1.0, other versions will be different.)

           

          The rest of your question I do not understand. But to define a datasource you need to create a *-ds.xml file and place it in the delpoy directory. You can see many examples for different databases at docs/examples/jca. If you define multiple datasources, each must have its own JNDI name.

          • 2. Re: Local-tx-datasource definition and custom
            Ken Barnes Newbie

            What i have is web services deployed that reference a datasource do calculations and return data.  I have multiple clients that access the web service and each needs access to a different database.  So i have 30 jndi datasources each representing one of the databases that when the client calls the web service i take the ip of the caller and find which datasource to use.  How can i dynamically make sure that each is using the correct datasource ??

             

            Thanks

            • 3. Re: Local-tx-datasource definition and custom
              Peter Johnson Master

              Give each datasource a different JNDI name. Create a  hashmap that maps the requestor's IP address to the JNDI name. Then use the looked-up JNDI name to access the datasource.