2 Replies Latest reply on Dec 23, 2002 9:42 AM by Albert Bupp

    Various JCA Implementations

    Albert Bupp Newbie


      I'm wondering about the apparent behavior of JBoss's JCA implementation. I've created a JCA adapter for SAP, and I'm testing it against various J2EE app servers, including JBoss 3.0.4.

      My question has to do w/ the specifics of how JBoss determines when to invoke my adapter's ManagedConnectionFactory.createManagedConnection method.

      From my reading of Sun's JCA specs, it appears that the expected invocation sequence should be:

      ConnectionFactory.getConnection() ->
      ConnectionManager.allocateConnection() ->
      and if no matching connection's found, then ->

      This is, in fact, how JBoss 3.0.4 seems to work. However, I'm also testing the adapter on JRun4. Based on the inspection of JRun's log output from both my adapter and an EJB I've created to invoke the adapter, I can see that as a result of the first call to:

      ConnectionFactory cxf = (ConnectionFactory) (new InitialContext()).lookup(jndiAdapterName);

      that JRun proceeds to invoke my adapter's createManagedConnection method, which then creates the physical connection to SAP.

      So, I'm wondering why the difference between the JCA implementations? Is it an example of legitimately different implementations? Or is there some way for the adapter's deployment descriptor to control when createManagedConnection gets invoked?

      Perhaps I'm simply confused about how it's supposed to work, but it's frustrating my efforts to write a generic EJB that interacts w/ the JCA adapter, which will work on both server platforms.

      Thanks for your time.

      Cheers, Albert

        • 1. Re: Various JCA Implementations
          David Jencks Master

          If your report on the jrun behavior is really correct, I think you can demonstrate that it is not spec compliant and won't (always) work by writing an adapter that requires some information in the ConnectionRequestInfo object in order to create the managed connection. This is supplied by the ConnectionFactory object when it calls allocateConnection on the connectionmanager, so there's no way for jrun to guess what you might supply.

          I imagine they are trying to pre-cache a connection so you won't have to wait when you ask for it, but I don't see how it can always work. What I did is, when you specify a pool minSize >0, is wait till you ask for one connection (so the ConnectionManager knows what security info you are providing), and then make minSIze connections using that info.

          • 2. Re: Various JCA Implementations
            Albert Bupp Newbie

            OK, that makes sense. Thanks for the insight into how JBoss handles establishing connections. I had suspected that JRun4 was operating somewhat outside the specs.