docs: public SITransaction getCurrentTransaction() throws IllegalStateException,
              ResourceException, SIException, SIErrorException
      {
  
          if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
              SibTr.entry(this, TRACE, "getCurrentTransaction");
          }
  
          if (_sessionClosed) {
              throw new IllegalStateException(NLS.getFormattedMessage(
                      ("ILLEGAL_STATE_CWSJR1130"),
                      new Object[] { "getCurrentTransaction"}, null));
          }
          if (_sessionInvalidated) {
              throw new IllegalStateException(NLS.getFormattedMessage(
                      ("ILLEGAL_STATE_CWSJR1134"),
                      new Object[] { "getCurrentTransaction"}, null));
          }
  
          SITransaction transaction = null;
  
          if (_applicationLocalTransaction != null) {
              transaction = _applicationLocalTransaction;
          } else {
  
              if (!_connection.getConnectionFactory().isManaged()) {
  
                  if (getTransacted()) {
                      _applicationLocalTransaction = _connection
                              .getSICoreConnection()
                              .createUncoordinatedTransaction();
  
                      // set rtn value..
                      transaction = _applicationLocalTransaction;
                  }
  
              } else {
  
                 transaction = getManagedConnection().getCurrentTransaction(
                              _connection.getConnectionManager());
  
                  if ((transaction == null) && (getTransacted())) {
  
                      try {
  
                          _applicationLocalTransaction = _connection
                                  .getSICoreConnection()
                                  .createUncoordinatedTransaction();
  
                      } catch (final SIException exception) {
  
                          FFDCFilter.processException(exception, CLASS_NAME
                                  + ".getCurrentTransaction", "1:306:1.47", this);
                          if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled()) {
                              SibTr.exception(this, TRACE, exception);
                          }
                          throw exception;
  
                      } catch (final SIErrorException exception) {
  
                          FFDCFilter.processException(exception, CLASS_NAME
                                  + ".getCurrentTransaction", "1:315:1.47", this);
                          if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled()) {
                              SibTr.exception(this, TRACE, exception);
                          }
                          throw exception;
  
                      }
  
                      _managedConnection.localTransactionStarted();
  
                      // set rtn value..
                      transaction = _applicationLocalTransaction;
                  }
  
              }
          }
  
          if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
              SibTr.exit(TRACE, "getCurrentTransaction", transaction);
          }
          return transaction;
      }