code: public TransactionScope<Txn> detachLocalScope() {
          TransactionScope<Txn> scope = mLocalScope.get();
          if (scope != null) {
              scope.markDetached();
              detachNotification(scope.getActiveTxn());
              mLocalScope.remove();
          }
          return scope;
      }
docs: Detaches the thread-local TransactionScope from the current thread. It
  can be {@link TransactionScope#attach attached} later, and to any thread
  which does not currently have a TransactionScope.
  
  @return detached thread-local TransactionScope or null if none
  @since 1.2