5 Replies Latest reply on Feb 28, 2008 9:52 AM by adrian.brock

    XADataSource vs. WrapperDataSource

    jhalliday

      Adrian or whoever is the resident JCA guru in this post-Weston era:

      Is there a way to get from the AS (4.2), a real XADataSource rather than the WrapperDataSource that is in JNDI? To do transaction recovery I need methods that are only on the XADataSource. Right now I'm facing the prospect of parsing the -ds.xml file myself to create the XADatasource or duplicating the same information in some other place. This seems ugly since the AS must process the file already. Is there some way to get the processed data from it rather than going back to the xml file again? Does AS 5.0 change the answer with all its fancy new meta data handling?

      Thanks

      Jonathan.

        • 1. Re: XADataSource vs. WrapperDataSource
          vickyk

          You can use MBean with ObjectName as
          jboss.jca:name=,service=ManagedConnectionFactory

          If you call the getManagedConnectionFactoryAttribute("XADataSourceClass") operation you will get the XADataSource class name , this basically comes from org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory method getXADataSourceClass() .
          http://anonsvn.jboss.org/repos/jbossas/trunk/connector/src/main/org/jboss/resource/connectionmanager/RARDeployment.java

          You can test the behavior through the jmx-console for a configured xa datasource.

          • 2. Re: XADataSource vs. WrapperDataSource
            jhalliday

            Ahh, cool, thanks. That's not quite what I need, but it's close enough to give be a good idea on how to proceed. Ideally I'd like to be able to call XAManagedConnectionFactory.getXADataSource but since it's not possible I'll settle for getXADataSourceClass plus getXADataSourceProperties which between them should give me all the info I need to create the datasource myself.

            • 3. Re: XADataSource vs. WrapperDataSource

              Jonathon. Go read the developers JCA forum.

              Doing this yourself is not the correct way. e.g. how do you know how to login
              if its using a security-domain?
              How does this apply to other resource adapters?

              This question has been repeated (and answered) so many times before,
              I don't understand why people are still trying to hack the wrong solution.

              • 4. Re: XADataSource vs. WrapperDataSource
                jhalliday

                Any thread in particular, or do I need to set aside a week or two to wade through the whole thing?

                You are right that what I did is a hack. The real solution in my view requires changes to the transactions integration spi. We can't do that in a CP release - any short term solution for EAP 4.x needs to work with the existing interfaces.

                Ultimately I want the AS to callback to the transaction manager when data sources for which it wants recovery enabled are deployed or undeployed.

                That means a new interface in the transaction spi, changes (to the data source deployers? maybe the JMS and cache too, basically anything that's using non-serializable XAResources) to lookup an implementation of that interface and invoke it, plus an implementation of the interface provided by the transaction manager.

                • 5. Re: XADataSource vs. WrapperDataSource

                   

                  "jhalliday" wrote:
                  Any thread in particular, or do I need to set aside a week or two to wade through the whole thing?


                  There's only 134 threads in that forum. It's not going to take a week to read just the titles.
                  Especially when on the second page there's huge thread entitled
                  "JcaXAResourceRecovery".