1 Reply Latest reply on Jun 15, 2008 3:10 AM by Nicolai Ødum

    Multiable JNDI names to one XA datasource

    Nicolai Ødum Newbie

      Simple question :-)

      Can anybody tell me how I can create multiable JNDI names that points to one XA datasource?

        • 1. Re: Multiable JNDI names to one XA datasource
          Nicolai Ødum Newbie

          Found the answer myself :-)

          <datasources>
           <xa-datasource>
           <jndi-name>jdbc/aConnection</jndi-name>
           <track-connection-by-tx/>
           <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
           <xa-datasource-property name="ServerName">localhost</xa-datasource-property>
           <xa-datasource-property name="PortNumber">5432</xa-datasource-property>
           <xa-datasource-property name="DatabaseName">someDB</xa-datasource-property>
           <xa-datasource-property name="User">someUser</xa-datasource-property>
           <xa-datasource-property name="Password">somePassword</xa-datasource-property>
           </xa-datasource>
           <mbean code="org.jboss.naming.NamingAlias" name="jboss.jmx:alias=aAlias">
           <attribute name="FromName">java:jdbc/aAlias</attribute>
           <attribute name="ToName">java:jdbc/aConnection</attribute>
           </mbean>
           <mbean code="org.jboss.naming.NamingAlias" name="jboss.jmx:alias=anotherAlias">
           <attribute name="FromName">java:jdbc/anotherAlias</attribute>
           <attribute name="ToName">java:jdbc/aConnection</attribute>
           </mbean>
          </datasources>