2 Replies Latest reply on Dec 25, 2001 11:32 PM by Guy Rouillier

    JDBC connection pool vs XA connection pool

    Guy Rouillier Newbie

      I'm switching a database connection pool from XA to simple JDBC. In the log, I was not seeing the pooled object being reused, though the number of objects in the pool was correct. Digging through the pool code to compare XA to JDBC caused me to pull out most of my already thin hair! I'm amazed at how different the implementation is for these two, and I don't understand the reason why. For example, I finally discovered that JDBC creates a new wrapper every time it hands out a connection, while XA does not. That's why JDBC gives out a new object every time, making it impossible to see what connections are getting reused where. Does anyone understand why such different approaches were taken? Another example is that closing a JDBC connection causes firing of a close event, while closing of an XA connection invokes the releaseObject method.

      What is the future for the database pooling code? Is it soon to be discarded in favor of the connector equivalents? If it is going to persist, I'll volunteer to assist in making some mods. I have one I promised Toby I'd make way back in the summer, and I see more needed.

        • 1. Re: JDBC connection pool vs XA connection pool
          David Jencks Master

          XADataSourceLoader and the XADataSourceImpl are gone from jboss 3. The basic pooling code is the same, and IMHO excessively complex and bug-ridden. The "JDBC" stuff is more or less replaced by the NoTrans ConnectionManager.

          I would certainly prefer that effort be put into making sure the connector code is spec compliant and works, however this may not line up with your immediate needs ;-) I do think the connector framework makes more sense than the 2.4 code it replaces (i.e., I can figure out what the connector code does, and I can't understand XADataSourceLoader).

          • 2. Re: JDBC connection pool vs XA connection pool
            Guy Rouillier Newbie

            David, thanks for the reply - I suspected the connector code was replacing the existing datasource classes. I managed over a lost weekend a couple months ago to figure out what XADataSourceLoader was doing - my goal was to figure out why userid/password were not being correctly honored. I managed to do that, and that is the change I wanted to get into the jbosspool classes. Rather than expend energy on dead-end code, I'll start looking into the connector code.