Hi Guys,

I am not sure If I should ask this question in this area but this is a closest match I found for my problem on this forum.

I am stuck at very unusual problem i.e. when I am deploying multiple instances of my web application, each instance is configured to use different data source (JCA Cx Factory) definition but both are end up using same data source (whichever used first). Let me explain a bit, say I have two instance of same web application renamed as ABCLive and ABCTest.

ABCLive deployment descriptor (web.xml) contains following resource ref definition;
Java Code:
     <resource-ref id="ResourceRef_ABCConnectionFactory">
          <description>ABC</description>
          <res-ref-name>jca/abcConnectionFactory</res-ref-name>
          <res-type>com.....ConnectionFactory</res-type>
          <res-auth>Container</res-auth>
     </resource-ref>
and corresponding jboss-web.xml has following mappings to bind above resource to an actual JNDI;
Java Code:
    <resource-ref>
        <res-ref-name>jca/abcConnectionFactory</res-ref-name>
        <res-type>com.....ConnectionFactory</res-type>
        <jndi-name>java:jca/abcConnectionFactoryLIVE</jndi-name>
    </resource-ref>
In ABCTest deployment descriptor (web.xml) contains following resource ref definition (exactly same, as we do not have to edit this bit);
Java Code:
     <resource-ref id="ResourceRef_ABCConnectionFactory">
          <description>ABC</description>
          <res-ref-name>jca/abcConnectionFactory</res-ref-name>
          <res-type>com.....ConnectionFactory</res-type>
          <res-auth>Container</res-auth>
     </resource-ref>
and corresponding jboss-web.xml has following mappings to bind above resource to some other JNDI
Java Code:
     <resource-ref>
        <res-ref-name>jca/abcConnectionFactory</res-ref-name>
        <res-type>com.....ConnectionFactory</res-type>
        <jndi-name>java:jca/abcConnectionFactoryTEST</jndi-name>
    </resource-ref>
Now theoretically when I will access 'http://localhost:8080/ABCLive' instance it should use resource 'jca/abcConnectionFactoryLive' and for 'http://localhost:8080/ABCTest' instance it should use resource 'jca/abcConnectionFactoryTEST', BUT that's not the case, whichever I use first the other will use the same. For example, if I use ABCTest instance first, it successfully access 'jca/abcConnectionFactoryTEST' and now when I start using 'ABCLive' instance it also uses 'jca/abcConnectionFactoryTEST' which is incorrect, it should use 'jca/abcConnectionFactoryLIVE' and vice versa.

NOTE: I am using jBoss 5.1.0 GA release and verified the behaviour on jBoss 6.0.0.Final but same setup is working on jBoss 4.2.3GA.

Your help and comments will be appreciated.

Thanks & regards

--

SJunejo