1 Reply Latest reply on Jul 30, 2013 9:32 AM by jesper.pedersen

    unwrapping WrapperDataSource

    mwiede

      Hi,

       

      I have a question regarding the unwrapping of WrapperDataSource. In the Tickets https://issues.jboss.org/browse/JBJCA-1065, the problem ist described. We would like to use the underlying datasource to open an Oracle Advanced Queuing Connection and we definetely need the Oracle datasource class. We could use reflection at this point, but from the discussion in https://issues.jboss.org/browse/JBJCA-944 I do not understand, why the unwrapping is not implemented.

       

      Does anybody know any best practice or alternative ways to retrieve a JNDI datasource in jboss AS?

       

      Best regards

      Matthais

        • 1. Re: unwrapping WrapperDataSource
          jesper.pedersen

          We don't support unwrapping a DataSource/XADataSource as it would expose the getConnection()/getXAConnection() methods. Calling these would result in connections not being controlled by IronJacamar.

           

          You could looking doing a proxy object solution for WrapperDataSource::getWrappedObject() which calls the WrapperDataSource methods, and only the underlying datasource for methods outside the spec. However, it isn't as simple as it sounds.

           

          So set the properties on the datasource that you need, and unwrap the connection instead - although it sounds like  Oracle Advanced Queuing has a wacky API.