3 Replies Latest reply on Feb 19, 2006 3:45 PM by joergvf

    Uses without session beans

    joergvf

      Hi,

      it would be nice if someone could give a statement whether the following is a supported scenario (either by spec and / or JBOSS ;)

      We're not using sessions beans, and we're using a JCA resource adapter (tx-connection-factory). The following steps are made:the cci.ConnectionFactory is looked up via JNDI
      a connection handle is obtained using getConnection() on the cci.ConnectionFactory, which in turn calls spi.ConnectionManager.allocateConnection()
      some non-transactional operations are performed on the connection
      UserTransaction.begin() is invoked
      the connection should be enlisted in the transaction.
      Unfortunately, step 4. does not enlist the connection in the transaction. If we first call UserTransaction.begin() and obtain the connection afterwards, the obtained connection is correctly enlisted.

      Shouldn't an existing connection be enlisted if a transaction is begun after the connection was obtained?

      Thanks for any information,
      Jörg

      P.S.
      I tried both <xa-transaction> and the default, and I set SpecCompliant to true for the org.jboss.resource.connectionmanager.CachedConnectionManager mbean.

        • 1. Re: Uses without session beans
          starksm64

          There is no spec that applies in the absence of a j2ee component with a container that understands how to do this association. What is the undefined context in which this is being done?

          • 2. Re: Uses without session beans

            In the JBoss context manager it is push/popMetaDataAwareContext()
            on the CachedConnectionManager.
            See the CachedConnectionManagerValve used in our Tomcat integration.

            • 3. Re: Uses without session beans
              joergvf

              Thank you for your answers!

              I'd rather like to stick to API specified in JSRs, though. I'm going to dump that JCA adapter and try to use the JTA API directly instead (even though the spec sounds a bit like the application server would use it to talk to itself only...)

              Would you discourage using the JTA directly?

              Regards,
              Jörg