Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-3860

XAManagedConnection should implement LocalTransaction to clean up hanging LocalTransaction

    XMLWordPrintable

Details

    Description

      Currently, XAManagedConnection does not implement the LocalTransaction interface. As a result the following conditions produces an error:

      @TransactionDemarcation(NotSupported)
      public void doSomething()
      {
      DataSource ds = ... (XADataSource)
      Connection c = ds.getConnection();
      c.setAutoCommit(false); // NOT Managed transaction
      // do stuff
      throw EJBException("Container/JCA should rollback uncommitted
      transaction!");
      }

      Because of the c.setAutoCommit(false), a LocalTransaction is started. When the EJBException is thrown, the transaction is left hanging. Typically this is handled in the TxConnectionEventListener for LocalManagedConnection. However, in the case of XAManagedConnection the get mc.getLocalTransaction() throws a ResourceException and the transaction is never rolled back.

      Attachments

        Activity

          People

            weston.price Weston M. Price (Inactive)
            weston.price Weston M. Price (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: