code: @Override
      public void contextChange(int typeOfChange, UOWScope scope) throws IllegalStateException
      {
          final boolean traceOn = TraceComponent.isAnyTracingEnabled();
  
          if (traceOn && tc.isEntryEnabled())
              Tr.entry(tc, "contextChange", new Object[] { typeOfChange, scope, this });
  
          try {
              // Determine the Tx change type and process.  Ensure we do what
              // we need to do as close to the context switch as possible
              switch (typeOfChange) {
                  case PRE_BEGIN:
                      try {
                          LTCCallbacks.instance().contextChange(typeOfChange);
                      } finally {
                          uowPreBegin();
                      }
                      break;
                  case POST_BEGIN:
                      try {
                          uowPostBegin(scope);
                      } finally {
                          LTCCallbacks.instance().contextChange(typeOfChange);
                      }
                      break;
                  case PRE_END:
                      try {
                          LTCCallbacks.instance().contextChange(typeOfChange);
                      } finally {
                          uowPreEnd(scope);
                      }
                      break;
                  case POST_END:
                      try {
                          uowPostEnd();
                      } finally {
                          LTCCallbacks.instance().contextChange(typeOfChange);
                      }
                      break;
                  default:
                      if (traceOn && tc.isDebugEnabled())
                          Tr.debug(tc, "Unknown typeOfChange: " + typeOfChange);
              }
          } catch (IllegalStateException ise) {
              if (traceOn && tc.isEntryEnabled())
                  Tr.exit(tc, "contextChange", ise);
              throw ise;
          }
  
          if (traceOn && tc.isEntryEnabled())
              Tr.exit(tc, "contextChange");
      }
docs: /*
  Notification from UserTransaction or UserActivitySession interface implementations
  that the state of a bean-managed UOW has changed. As a result of this bean-managed
  UOW change we may have to change the LTC that's on the thread.