code: protected synchronized final Transaction getExternalTransaction()
      {
          final String methodName = "getExternalTransaction";
          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
              trace.entry(this,
                          cclass,
                          methodName);
          Transaction transaction = null; // For return.
          if (transactionReference != null)
              transaction = (Transaction) transactionReference.get();
  
          if (transaction == null) {
              transaction = new Transaction(this);
              // Make a WeakReference that becomes Enqueued as a result of the external Transaction becoming unreferenced.
              transactionReference = new TransactionReference(this,
                                                              transaction);
          } // if (transaction == null).
  
          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
              trace.exit(this,
                         cclass,
                         methodName,
                         new Object[] { transaction });
          return transaction;
      }
docs: Create the extrnal transaction for use by the public interface
  from this InternalTransaction.
  
  To detect orphaned Transactions, ie. Transactions not referenced elsewhere in the JVM,
  we will keep a reference to the internalTransaction and make a weak reference to the
  container we pass to the application. When the container Transaction appears on the
  orphanTransactionsQueue we know the calling application has lost all references to it.
  At this point we can attempt to reuse it.
  
  @return transaction the new transaction.