code: boolean setLocalScope(TransactionScope<Txn> scope, boolean detached) {
          TransactionScope<Txn> existing = mLocalScope.get();
          if (((existing == null || existing.isInactive()) && detached) || existing == scope) {
              attachNotification(scope.getActiveTxn());
              mLocalScope.set(scope);
              return true;
          }
          return false;
      }
docs: Called by TransactionScope.