code: @Override
      EntityManager getEMInvocationInfo(boolean requireTx, LockModeType mode)
      {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
  
          if (isTraceOn && tc.isEntryEnabled())
          {
              Tr.entry(tc, "getEMInvocationInfo : " + requireTx + " : " + ((mode == null) ? "null" : mode));
          }
  
          if (requireTx || (mode != null && !LockModeType.NONE.equals(mode)))
          {
              throw new UnsupportedOperationException("This entity manager cannot perform operations that require a transactional context");
          }
  
          if (!ivEnlisted)
          {
              UOWCoordinator uowCoord = ivAbstractJPAComponent.getUOWCurrent().getUOWCoord();
              // Enlist in either the global tran or LTC
              if (uowCoord.isGlobal())
              {
                  // Register invocation object to transaction manager for clean up
                  registerEmInvocation(uowCoord, this); //d638095.2
              }
              else
              {
                  // Register invocation object to LTC for clean up
                  LocalTransactionCoordinator ltCoord = (LocalTransactionCoordinator) uowCoord;
                  ltCoord.enlistSynchronization(this);
              }
              // Mark this em as enlisted for clean up
              ivEnlisted = true;
          }
  
          if (isTraceOn && tc.isEntryEnabled())
              Tr.exit(tc, "getEMInvocationInfo : " + ivEm);
          return ivEm;
      }
docs: (non-Javadoc)
  
  Verifies that the intent of the invocation is read-only, enlists in the global or LTC and
  returns the pooled entity manager.