/*
@see com.ibm.ws.http.channel.internal.HttpServiceContextImpl#updatePersistence(com.ibm.ws.http.channel.internal.HttpBaseMessageImpl)
347862
@Override
    protected void updatePersistence(HttpBaseMessageImpl msg) {

        // see if the maximum number of inbound requests have been served
        // otherwise check the msg headers
        if (this.myLink.maxRequestsServed()) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Max requests already processed on this connection");
            }
            setPersistent(false);
        } else if (getResponse().getStatusCode().isErrorCode()) {
            // 346196.4 - error code turns off persistence
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Error status code disabling persistence.");
            }
            setPersistent(false);
        } else {
            super.updatePersistence(msg);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "updatePersistence(inbound) updated: " + isPersistent());
        }
    }
977064
@Override
	public synchronized void addOrUpdateMessages(ApptentiveMessage... apptentiveMessages) {
		fetchEntries();

		for (ApptentiveMessage apptentiveMessage : apptentiveMessages) {
			MessageEntry existing = findMessageEntry(apptentiveMessage);
			if (existing != null) {
				// Update
				existing.id = apptentiveMessage.getId();
				existing.state = apptentiveMessage.getState().name();
				if (apptentiveMessage.isRead()) { // A message can't be unread after being read.
					existing.isRead = true;
				}
				existing.json = apptentiveMessage.getJsonObject().toString();
			} else {
				// Insert
				MessageEntry entry = new MessageEntry();
				entry.id = apptentiveMessage.getId();
				entry.clientCreatedAt = apptentiveMessage.getClientCreatedAt();
				entry.nonce = apptentiveMessage.getNonce();
				entry.state = apptentiveMessage.getState().name();
				entry.isRead = apptentiveMessage.isRead();
				entry.json = apptentiveMessage.getJsonObject().toString();
				messageEntries.add(entry);
			}
		}

		writeToFile();
	}
714087
public StepThreadExecutionEntity updateStepExecutionOnRecovery(PersistenceServiceUnit psu,
                                                                   final long stepExecutionId,
                                                                   final BatchStatus newStepBatchStatus,
                                                                   final String newStepExitStatus,
                                                                   final Date endTime) throws IllegalArgumentException {

        EntityManager em = psu.createEntityManager();
        try {
            return new TranRequest<StepThreadExecutionEntity>(em) {
                @Override
                public StepThreadExecutionEntity call() {

                    StepThreadExecutionEntity stepExec = entityMgr.find(StepThreadExecutionEntity.class, stepExecutionId);
                    if (stepExec == null) {
                        throw new IllegalArgumentException("StepThreadExecEntity with id =" + stepExecutionId + " should be persisted at this point, but didn't find it.");
                    }

                    try {
                        verifyThreadStatusTransitionIsValid(stepExec, newStepBatchStatus);
                    } catch (BatchIllegalJobStatusTransitionException e) {
                        throw new PersistenceException(e);
                    }

                    stepExec.setBatchStatus(newStepBatchStatus);
                    stepExec.setExitStatus(newStepExitStatus);
                    stepExec.setEndTime(endTime);
                    return stepExec;
                }
            }.runInNewOrExistingGlobalTran();
        } finally {
            em.close();
        }
    }
585517
function onSetPersistence() {
  var type = $('#persistence-type').val();
  try {
    auth.setPersistence(type).then(function() {
      log('Persistence state change to "' + type + '".');
      alertSuccess('Persistence state change to "' + type + '".');
    }, function(error) {
      alertError('Error: ' + error.code);
    });
  } catch (error) {
    alertError('Error: ' + error.code);
  }
}
1053267
@Override
   public synchronized void updateCurrentTopology(List<Address> newMembers) {
      // The current topology might be null just after a joiner became the coordinator
      if (currentTopology == null) {
         createInitialCacheTopology();
      }
      ConsistentHashFactory<ConsistentHash> consistentHashFactory = getJoinInfo().getConsistentHashFactory();
      int topologyId = currentTopology.getTopologyId();
      int rebalanceId = currentTopology.getRebalanceId();
      ConsistentHash currentCH = currentTopology.getCurrentCH();
      ConsistentHash pendingCH = currentTopology.getPendingCH();
      if (!needConsistentHashUpdate()) {
         log.tracef("Cache %s members list was updated, but the cache topology doesn't need to change: %s",
               cacheName, currentTopology);
         return;
      }

      if (newMembers.isEmpty()) {
         log.tracef("Cache %s no longer has any members, removing topology", cacheName);
         setCurrentTopology(null);
         setStableTopology(null);
         rebalanceConfirmationCollector = null;
         status = ComponentStatus.INSTANTIATED;

         return;
      }


      List<Address> newCurrentMembers = pruneInvalidMembers(currentCH.getMembers());
      ConsistentHash newCurrentCH, newPendingCH = null;
      CacheTopology.Phase newPhase = CacheTopology.Phase.NO_REBALANCE;
      List<Address> actualMembers;
      if (newCurrentMembers.isEmpty()) {
         // All the current members left, try to replace them with the joiners
         log.tracef("All current members left, re-initializing status for cache %s", cacheName);
         rebalanceConfirmationCollector = null;

         newCurrentMembers = getExpectedMembers();
         actualMembers = newCurrentMembers;
         newCurrentCH = joinInfo.getConsistentHashFactory().create(
               joinInfo.getHashFunction(), joinInfo.getNumOwners(), joinInfo.getNumSegments(),
               newCurrentMembers, getCapacityFactors());
      } else {
         // ReplicatedConsistentHashFactory allocates segments to all its members, so we can't add any members here
         newCurrentCH = consistentHashFactory.updateMembers(currentCH, newCurrentMembers, getCapacityFactors());
         actualMembers = newCurrentMembers;
         if (pendingCH != null) {
            newPhase = currentTopology.getPhase();
            List<Address> newPendingMembers = pruneInvalidMembers(pendingCH.getMembers());
            newPendingCH = consistentHashFactory.updateMembers(pendingCH, newPendingMembers, getCapacityFactors());
            actualMembers = pruneInvalidMembers(newPendingMembers);
         }
      }
      // Losing members during state transfer could lead to a state where we have more than two topologies
      // concurrently in the cluster. We need to make sure that all the topologies are compatible (properties set
      // in CacheTopology docs hold) - we just remove lost members.
      CacheTopology newTopology = new CacheTopology(topologyId + 1, rebalanceId, newCurrentCH, newPendingCH,
            newPhase, actualMembers, persistentUUIDManager.mapAddresses(actualMembers));
      setCurrentTopology(newTopology);

      if (rebalanceConfirmationCollector != null) {
         // The node that will cancel the state transfer because of another topology update won't send topology confirm
         log.debugf("Cancelling topology confirmation %s because of another topology update", rebalanceConfirmationCollector);
         rebalanceConfirmationCollector = null;
      }

      CLUSTER.updatingTopology(cacheName, newTopology, availabilityMode);
      eventLogger.info(EventLogCategory.CLUSTER, MESSAGES.cacheMembersUpdated(
         actualMembers, newTopology.getTopologyId()));
      clusterTopologyManager.broadcastTopologyUpdate(cacheName, newTopology, availabilityMode,
            isTotalOrder(), isDistributed());
   }
1359501
public java.lang.String getPersistenceState() {
    java.lang.Object ref = persistenceState_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      if (bs.isValidUtf8()) {
        persistenceState_ = s;
      }
      return s;
    }
  }
1319195
public void setPersistentItems(boolean persist)  {
        addField(ConfigureNodeFields.persist_items, FormField.Type.bool);
        setAnswer(ConfigureNodeFields.persist_items.getFieldName(), persist);
    }
241080
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CPOptionValue updateCPOptionValue(CPOptionValue cpOptionValue) {
		return cpOptionValuePersistence.update(cpOptionValue);
	}
1006738
public void addPersistenceUnits(JPAPXml pxml) {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isDebugEnabled())
            Tr.debug(tc, "addPersistenceUnits", pxml);

        JPAPuScope puScope = pxml.getPuScope();
        String scopeKey = (puScope == JPAPuScope.EAR_Scope) ? EAR_SCOPE_MODULE_NAME : pxml.getArchiveName();

        JPAScopeInfo scopeInfo = null;
        synchronized (puScopes) {
            scopeInfo = puScopes.get(scopeKey);
            if (scopeInfo == null) {
                scopeInfo = new JPAScopeInfo(scopeKey, puScope);
                puScopes.put(scopeKey, scopeInfo);
            }
        }

        // delegate to scopeInfo to read in the persistence-unit data
        JPAIntrospection.beginPUScopeVisit(scopeInfo);
        try {
            scopeInfo.processPersistenceUnit(pxml, this);
        } finally {
            JPAIntrospection.endPUScopeVisit();
        }
    }
527977
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CPRule updateCPRule(CPRule cpRule) {
		return cpRulePersistence.update(cpRule);
	}
561598
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CPMeasurementUnit updateCPMeasurementUnit(
		CPMeasurementUnit cpMeasurementUnit) {
		return cpMeasurementUnitPersistence.update(cpMeasurementUnit);
	}
108946
private void updateSession(Session newSession) {
        if (this.currentSession == null) {
            this.currentSession = newSession;
        } else {
            synchronized (this.currentSession) {
                this.currentSession = newSession;
            }
        }
    }
685958
private final void setPersNew() {
		status = ObjectState.PERSISTENT_NEW;
		stateFlags = PS_PERSISTENT | PS_TRANSACTIONAL | PS_DIRTY | PS_NEW;
		context.getSession().internalGetCache().notifyDirty(this);
	}
444465
public void updateLastTimeSMPPLinkUpdated() {
		lastTimeSMPPLinkUpdated = System.currentTimeMillis();
		if(logger.isDebugEnabled())
			logger.debug("Updated Last Client " + channel.getRemoteAddress().toString() + " Enquire Link time update " + lastTimeSMPPLinkUpdated);
	}
973689
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CPSpecificationOption updateCPSpecificationOption(
		CPSpecificationOption cpSpecificationOption) {
		return cpSpecificationOptionPersistence.update(cpSpecificationOption);
	}
131688
public void updateCurrentCustomer(@NonNull CustomerRetrievalListener listener) {
        mCustomer = null;

        final String operationId = UUID.randomUUID().toString();
        mCustomerRetrievalListeners.put(operationId, listener);
        mEphemeralKeyManager.retrieveEphemeralKey(operationId, null, null);
    }
518860
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CommerceWarehouse updateCommerceWarehouse(
		CommerceWarehouse commerceWarehouse) {
		return commerceWarehousePersistence.update(commerceWarehouse);
	}