Called by interceptor when incoming request arrives.
This polices the single threaded operation of the transaction.
327737
@Override
    public synchronized void addAssociation() {
        final boolean traceOn = TraceComponent.isAnyTracingEnabled();

        if (traceOn && tc.isEntryEnabled())
            Tr.entry(tc, "addAssociation");

        if (_activeAssociations > _suspendedAssociations) {
            if (traceOn && tc.isDebugEnabled())
                Tr.debug(tc, "addAssociation received incoming request for active context");
            try {
                setRollbackOnly();
            } catch (Exception ex) {
                FFDCFilter.processException(ex, "com.ibm.ws.Transaction.JTA.TransactionImpl.addAssociation", "1701", this);
                if (traceOn && tc.isDebugEnabled())
                    Tr.debug(tc, "setRollbackOnly threw exception", ex);
                // swallow this exception
            }

            if (traceOn && tc.isEntryEnabled())
                Tr.exit(tc, "addAssociation throwing rolledback");
            throw new TRANSACTION_ROLLEDBACK("Context already active");
        }

        stopInactivityTimer();
        _activeAssociations++;

        if (traceOn && tc.isEntryEnabled())
            Tr.exit(tc, "addAssociation");
    }
967519
public void requestModificationLock() {
    lock.readLock().lock();
    if (!veto)
      return;

    if (throwException) {
      lock.readLock().unlock();
      throw new OModificationOperationProhibitedException("Modification requests are prohibited");
    }

    boolean wasInterrupted = false;
    Thread thread = Thread.currentThread();
    waiters.add(thread);

    while (veto) {
      LockSupport.park(this);
      if (Thread.interrupted())
        wasInterrupted = true;
    }

    waiters.remove(thread);
    if (wasInterrupted)
      thread.interrupt();
  }
889206
public void postInvoke( InterceptorContext context, InterceptorChain chain ) throws InterceptorException
    {
        postAction( ( ActionInterceptorContext ) context, chain );
    }
254793
private void awaitRequestsCompletion() throws IOException {
    // Don't wait until all requests will be completed if enough requests are pending for full batch
    while (!responseFutures.isEmpty() && pendingRequests.size() < maxRequestsPerBatch) {
      try {
        responseFutures.remove().get();
      } catch (InterruptedException | ExecutionException e) {
        if (e.getCause() instanceof IOException) {
          throw (IOException) e.getCause();
        }
        throw new RuntimeException("Failed to execute batch", e);
      }
    }
  }
1055778
function (transaction) {
	    if (this._pendingElement != null) {
	      ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context);
	    } else if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
	      this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
	    } else {
	      this._updateBatchNumber = null;
	    }
	  }
1099072
public void update( Transaction transaction ) {
    RestfulUtils.update( TransactionService.PATH, transaction, Transaction.class, super.httpClient );
  }
910980
protected synchronized void notifyFromCheckpoint(Token token,
                                                     Transaction transaction)
                    throws ObjectManagerException {
        final String methodName = "notifyFromCheckpoint";
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass, methodName, new Object[] { token,
                                                                transaction });

        allPersistentTokensToNotify.add(token);
        token.getManagedObject().optimisticReplaceLogged(transaction);

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass, methodName);
    }
680754
def process_request(self, request):
        """"""
        batcher = PrioritizedBatcher.global_instance()
        if batcher.is_started:
            # This can happen in old-style middleware if consequent middleware
            # raises exception and thus `process_response` is not called.
            # Described under 3rd point of differences:
            # https://docs.djangoproject.com/en/1.11/topics/http/middleware/#upgrading-pre-django-1-10-style-middleware
            batcher.rollback()
            logger.warning(
                "Uncommited batcher transaction from previous request was rollbacked."
            )

        batcher.start()
93529
public void preInvoke( InterceptorContext context, InterceptorChain chain ) throws InterceptorException
    {
        preRequest( ( RequestInterceptorContext ) context, chain );
    }
278251
def process_request_thread(self, request, client_address):
        
        try:
            self.finish_request(request, client_address)
            self.shutdown_request(request)
        except:
            self.handle_error(request, client_address)
            self.shutdown_request(request)
14511
private void afterBeginCallback() {
		if ( this.timeOut > 0 ) {
			owner.setTransactionTimeOut( this.timeOut );
		}
		owner.afterTransactionBegin();
		for ( TransactionObserver observer : observers ) {
			observer.afterBegin();
		}
		log.trace( "ResourceLocalTransactionCoordinatorImpl#afterBeginCallback" );
	}
558148
def tap(self, interceptor):
        
        interceptor(self.obj)
        return self._wrap(self.obj)
1117981
@Override
    public OrderableTransaction poll() {
        OrderableTransaction retval = null;
        updateQueueState();
        if (m_state == QueueState.UNBLOCKED) {
            retval = super.peek();
            super.poll();
            // not BLOCKED_EMPTY
            assert(retval != null);
        }
        return retval;
    }
866374
final void cmdRequestUpdate(final PersistentTransaction transaction) throws SevereMessageStoreException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "cmdRequestUpdate", new Object[] { "Item Link:   " + this, "Stream Link: " + _owningStreamLink, "Transaction: " + transaction });

        boolean hasBecomeNotReleasable = false;
        synchronized (this)
        {
            if (ItemLinkState.STATE_AVAILABLE == _itemLinkState)
            {

                ListStatistics stats = getParentStatistics();
                synchronized (stats)
                {
                    stats.decrementAvailable();
                    stats.incrementUpdating();
                }

                _transactionId = transaction.getPersistentTranId();
                hasBecomeNotReleasable = _declareNotDiscardable(_getItemNoRestore());
                _itemLinkState = ItemLinkState.STATE_UPDATING_DATA;
            }
            else
            {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                    SibTr.event(this, tc, "Invalid Item state: " + _itemLinkState);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(this, tc, "cmdRequestUpdate");
                throw new StateException(_itemLinkState.toString());
            }
        }
        if (hasBecomeNotReleasable)
        {
            _declareNotReleasable();
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "cmdRequestUpdate");
    }
1130730
private void initCld(final TransactionImpl tx)
    {
        final IndirectionHandler handler = ProxyHelper.getIndirectionHandler(obj);
        if(handler != null)
        {
            this.handler = handler;
            isNew = Boolean.FALSE;
            identity = handler.getIdentity();
            if(handler.alreadyMaterialized())
            {
                cld = tx.getBroker().getClassDescriptor(handler.getRealSubject().getClass());
            }
            else
            {
                cld = tx.getBroker().getClassDescriptor(identity.getObjectsRealClass());
            }
        }
        else
        {
            cld = tx.getBroker().getClassDescriptor(obj.getClass());
        }
    }
1320601
public static void clientBeforeSend(SofaRequest request) {
        if (openTrace) {
            try {
                tracer.clientBeforeSend(request);
            } catch (Exception e) {
                if (LOGGER.isWarnEnabled()) {
                    LOGGER.warn(e.getMessage(), e);
                }
            }
        }
    }
1300229
private static Request wrap(final Request req) {
        final AtomicBoolean seen = new AtomicBoolean(false);
        return new Request() {
            @Override
            public Iterable<String> head() throws IOException {
                return req.head();
            }

            @Override
            public InputStream body() throws IOException {
                if (!seen.getAndSet(true)) {
                    throw new IllegalStateException(
                        "It's not allowed to call body() more than once"
                    );
                }
                return req.body();
            }
        };
    }