3 Replies Latest reply on Apr 16, 2012 3:38 PM by Jesper Pedersen

    Connection factory JNDI naming

    Dejan Kitic Newbie

      Hi there,

      documentation states( if I understood well ) that it's posible to  bind connection factory name ( ironjacamar.xml ) to something that is related to deployment name (ie name of the rar file beeing deployed).

      I was unable to find a way to do that, what I actually need is a way to have connection factory to bind to JNDI with name dependent on deployment name, is this possible?

      Say something like jndi-name="my_cc_factory" where it would actually bind to say java://eis/my_deployment_name/my_cc_factory




        • 1. Re: Connection factory JNDI naming
          Jesper Pedersen Master

          The ironjacamar.xml doesn't need an <archive> element, since it knows which .rar it belongs too.


          The subsystem:resource-adapters in AS7 contains that element, since it needs to know which .rar to activate.


          The <connection-definition> element contains the JNDI name for the CF bound into JNDI based on the MCF instance.



          • 2. Re: Connection factory JNDI naming
            Dejan Kitic Newbie

            Maybe I didnt explain well... If my ironjacamar.xml contains something like this and my rar is my_example.rar :


                <connection-definition class-name="com.deki.example.MyManagedConnectionFactory"  jndi-name="java:/eis/MyConnectionFactory" pool-name="MyCciConnectionFactory">

                  <config-property name="name">My Managed Connection Factory</config-property>



            This will bind com.deki.example.MyManagedConnectionFactory under java:/eis/MyConnectionFactory

            where jndi-name is required attribute. Is there a way to make com.deki.example.MyManagedConnectionFactory bind to something that depends on the name of deployed archive in this case my_example.rar?

            Maybe say jndi-name="MyMCF" but com.deki.example.MyManagedConnectionFactory would bind to say java:/my_example/MyMCF ?



            • 3. Re: Connection factory JNDI naming
              Jesper Pedersen Master

              Ah, then no.


              You could have multiple activations of the same MCF class, so that would lead to problems.