docs: @FFDCIgnore(Exception.class)
      long getPartitionId() throws Exception {
          partitionIdLock.readLock().lock();
          try {
              if (partitionId != 0)
                  return partitionId;
          } finally {
              partitionIdLock.readLock().unlock();
          }
  
          PartitionRecord partitionEntry = new PartitionRecord(false);
          partitionEntry.setExecutor(name);
          partitionEntry.setLibertyServer(locationAdmin.getServerName());
          partitionEntry.setUserDir(variableRegistry.resolveString(VariableRegistry.USER_DIR));
          partitionEntry.setHostName(AccessController.doPrivileged(getHostName));
  
          // Run under a new transaction and commit right away
          EmbeddableWebSphereTransactionManager tranMgr = tranMgrRef.getServiceWithException();
          int tranStatus = tranMgr.getStatus();
          LocalTransactionCurrent ltcCurrent = tranStatus == Status.STATUS_NO_TRANSACTION ? localTranCurrentRef.getServiceWithException() : null;
          LocalTransactionCoordinator suspendedLTC = ltcCurrent == null ? null : ltcCurrent.suspend();
          Transaction suspendedTran = tranStatus == Status.STATUS_ACTIVE ? tranMgr.suspend() : null;
          Exception failure = null;
          try {
              partitionIdLock.writeLock().lock();
              try {
                  if (partitionId != 0)
                      return partitionId;
  
                  Long newPartitionId = null;
                  for (int i = 0; i < 2 && newPartitionId == null && !deactivated; i++) {
                      failure = null;
                      tranMgr.begin();
                      try {
                          newPartitionId = taskStore.findOrCreate(partitionEntry);
                      } catch (Exception x) {
                          failure = x;
                          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                              Tr.debug(this, tc, "deactivated? " + deactivated, x);
                      } finally {
                          if (failure == null && newPartitionId != null) {
                              tranMgr.commit();
                              partitionId = newPartitionId;
                          } else
                              tranMgr.rollback();
                      }
                  }
  
                  return partitionId;
              } finally {
                  partitionIdLock.writeLock().unlock();
              }
          } finally {
              try {
                  // resume
                  if (suspendedTran != null)
                      tranMgr.resume(suspendedTran);
                  else if (suspendedLTC != null)
                      ltcCurrent.resume(suspendedLTC);
              } finally {
                  if (failure != null)
                      throw failure;
              }
          }
      }