Reads the SchemaConcept labels currently in the transaction cache
into the keyspace cache. This happens when a commit occurs and allows us to track schema
mutations without having to read the graph.

@param transactionCache The transaction cache
559358
void readTxCache(TransactionCache transactionCache) {
        //Check if the schema has been changed and should be flushed into this cache
        if (!cachedLabels.equals(transactionCache.getLabelCache())) {
            try {
                lock.writeLock().lock();
                cachedLabels.clear();
                cachedLabels.putAll(transactionCache.getLabelCache());
            } finally {
                lock.writeLock().unlock();
            }
        }
    }
523972
@Override
	public void cacheResult(
		List<CommerceAccountOrganizationRel> commerceAccountOrganizationRels) {
		for (CommerceAccountOrganizationRel commerceAccountOrganizationRel : commerceAccountOrganizationRels) {
			if (entityCache.getResult(
						CommerceAccountOrganizationRelModelImpl.ENTITY_CACHE_ENABLED,
						CommerceAccountOrganizationRelImpl.class,
						commerceAccountOrganizationRel.getPrimaryKey()) == null) {
				cacheResult(commerceAccountOrganizationRel);
			}
			else {
				commerceAccountOrganizationRel.resetOriginalValues();
			}
		}
	}
715364
@Override
	public void cacheResult(List<CommerceOrder> commerceOrders) {
		for (CommerceOrder commerceOrder : commerceOrders) {
			if (entityCache.getResult(
						CommerceOrderModelImpl.ENTITY_CACHE_ENABLED,
						CommerceOrderImpl.class, commerceOrder.getPrimaryKey()) == null) {
				cacheResult(commerceOrder);
			}
			else {
				commerceOrder.resetOriginalValues();
			}
		}
	}
654230
public static TransactionException transactionReadOnly(TransactionOLTP tx) {
        return create(ErrorMessage.TRANSACTION_READ_ONLY.getMessage(tx.keyspace()));
    }
455580
public boolean syncLabels(NewRelicCache cache)
    {
        boolean ret = true;

        if(apiClient == null)
            throw new IllegalArgumentException("null API client");

        // Get the label configuration using the REST API
        if(cache.isApmEnabled() || cache.isSyntheticsEnabled())
        {
            ret = false;

            logger.info("Getting the labels");
            Collection<Label> labels = apiClient.labels().list();
            for(Label label : labels)
            {
                cache.applications().addLabel(label);

                try
                {
                    // Also check to see if this label is associated with any monitors
                    Collection<Monitor> monitors = syntheticsApiClient.monitors().list(label);
                    for(Monitor monitor : monitors)
                       cache.monitors().labels(monitor.getId()).add(label);
                }
                catch(NullPointerException e)
                {
                    logger.severe("Unable to get monitor labels: "+e.getClass().getName()+": "+e.getMessage());
                }
            }

            cache.setUpdatedAt();

            ret = true;
        }

        return ret;
    }
736783
@Override
	public void cacheResult(List<CommerceAccount> commerceAccounts) {
		for (CommerceAccount commerceAccount : commerceAccounts) {
			if (entityCache.getResult(
						CommerceAccountModelImpl.ENTITY_CACHE_ENABLED,
						CommerceAccountImpl.class,
						commerceAccount.getPrimaryKey()) == null) {
				cacheResult(commerceAccount);
			}
			else {
				commerceAccount.resetOriginalValues();
			}
		}
	}
605722
private void copyToCache(SchemaConcept schemaConcept) {
        schemaConcept.subs().forEach(concept -> keyspaceCache.cacheLabel(concept.label(), concept.labelId()));
    }
105181
static void saveSchemas(MessageStore msgStore, JMFSchema[] schemas) throws MessageEncodeFailedException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "saveSchemas");
    try {
      // Get the SchemaStore reference, creating a new one if necessary
      SchemaStoreItemStream schemaStore = getSchemaStore(msgStore);

      // Check if any new schemas need to be persisted to the SchemaStore
      for (int i = 0; i < schemas.length; i++) {
        if (!schemaStore.containsSchema(schemas[i].getLongID())) {
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Saving schema:" + schemas[i].getID());
          schemaStore.addSchema(schemas[i], msgStore.getTransactionFactory().createAutoCommitTransaction());
        }
      }
    } catch (MessageStoreException e) {
      FFDCFilter.processException(e, "saveSchemas", "83");
      throw new MessageEncodeFailedException(e);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "saveSchemas");
  }
545446
@Override
	public void cacheResult(List<CommerceWarehouse> commerceWarehouses) {
		for (CommerceWarehouse commerceWarehouse : commerceWarehouses) {
			if (entityCache.getResult(
						CommerceWarehouseModelImpl.ENTITY_CACHE_ENABLED,
						CommerceWarehouseImpl.class,
						commerceWarehouse.getPrimaryKey()) == null) {
				cacheResult(commerceWarehouse);
			}
			else {
				commerceWarehouse.resetOriginalValues();
			}
		}
	}
1002869
@Override
    public boolean afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock) throws CacheException {
        log.debug("region access strategy nonstrict-read-write entity afterUpdate() {} {}", getInternalRegion().getCacheNamespace(), key);
        getInternalRegion().evict(key);
        return false;
    }
156831
public ResultSet getImportedKeysUsingInformationSchema(String catalog, String table)
      throws SQLException {
    if (table == null) {
      throw new SQLException("'table' parameter in getImportedKeys cannot be null");
    }
    String sql =
        "SELECT KCU.REFERENCED_TABLE_SCHEMA PKTABLE_CAT, NULL PKTABLE_SCHEM,  KCU.REFERENCED_TABLE_NAME PKTABLE_NAME,"
            + " KCU.REFERENCED_COLUMN_NAME PKCOLUMN_NAME, KCU.TABLE_SCHEMA FKTABLE_CAT, NULL FKTABLE_SCHEM, "
            + " KCU.TABLE_NAME FKTABLE_NAME, KCU.COLUMN_NAME FKCOLUMN_NAME, KCU.POSITION_IN_UNIQUE_CONSTRAINT KEY_SEQ,"
            + " CASE update_rule "
            + "   WHEN 'RESTRICT' THEN 1"
            + "   WHEN 'NO ACTION' THEN 3"
            + "   WHEN 'CASCADE' THEN 0"
            + "   WHEN 'SET NULL' THEN 2"
            + "   WHEN 'SET DEFAULT' THEN 4"
            + " END UPDATE_RULE,"
            + " CASE DELETE_RULE"
            + "  WHEN 'RESTRICT' THEN 1"
            + "  WHEN 'NO ACTION' THEN 3"
            + "  WHEN 'CASCADE' THEN 0"
            + "  WHEN 'SET NULL' THEN 2"
            + "  WHEN 'SET DEFAULT' THEN 4"
            + " END DELETE_RULE,"
            + " RC.CONSTRAINT_NAME FK_NAME,"
            + " NULL PK_NAME,"
            + importedKeyNotDeferrable + " DEFERRABILITY"
            + " FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE KCU"
            + " INNER JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS RC"
            + " ON KCU.CONSTRAINT_SCHEMA = RC.CONSTRAINT_SCHEMA"
            + " AND KCU.CONSTRAINT_NAME = RC.CONSTRAINT_NAME"
            + " WHERE "
            + catalogCond("KCU.TABLE_SCHEMA", catalog)
            + " AND "
            + " KCU.TABLE_NAME = " + escapeQuote(table)
            + " ORDER BY PKTABLE_CAT, PKTABLE_SCHEM, PKTABLE_NAME, KEY_SEQ";

    return executeQuery(sql);
  }
211759
@Override
    public void delete() {
        if (deletionAllowed()) {
            //Force load of linked concepts whose caches need to be updated
            T superConcept = cachedSuperType.get();

            deleteNode();

            //Update neighbouring caches
            SchemaConceptImpl.from(superConcept).deleteCachedDirectedSubType(getThis());

            //clear rule cache
            vertex().tx().ruleCache().clear();
        } else {
            throw TransactionException.cannotBeDeleted(this);
        }
    }
708987
@Override
	public void cacheResult(CommerceRegion commerceRegion) {
		entityCache.putResult(CommerceRegionModelImpl.ENTITY_CACHE_ENABLED,
			CommerceRegionImpl.class, commerceRegion.getPrimaryKey(),
			commerceRegion);

		finderCache.putResult(FINDER_PATH_FETCH_BY_UUID_G,
			new Object[] { commerceRegion.getUuid(), commerceRegion.getGroupId() },
			commerceRegion);

		finderCache.putResult(FINDER_PATH_FETCH_BY_C_C,
			new Object[] {
				commerceRegion.getCommerceCountryId(), commerceRegion.getCode()
			}, commerceRegion);

		commerceRegion.resetOriginalValues();
	}
458305
protected void flushEntityCache() {
    List<CachedDbEntity> cachedEntities = dbEntityCache.getCachedEntities();
    for (CachedDbEntity cachedDbEntity : cachedEntities) {
      flushCachedEntity(cachedDbEntity);
    }

    // log cache state after flush
    LOG.flushedCacheState(dbEntityCache.getCachedEntities());
  }
634286
@Override
	public void cacheResult(
		CommerceNotificationQueueEntry commerceNotificationQueueEntry) {
		entityCache.putResult(CommerceNotificationQueueEntryModelImpl.ENTITY_CACHE_ENABLED,
			CommerceNotificationQueueEntryImpl.class,
			commerceNotificationQueueEntry.getPrimaryKey(),
			commerceNotificationQueueEntry);

		commerceNotificationQueueEntry.resetOriginalValues();
	}
754782
public static TransactionException cannotBeDeleted(SchemaConcept schemaConcept) {
        return create(ErrorMessage.CANNOT_DELETE.getMessage(schemaConcept.label()));
    }
957910
public void loadSchemaInformation(final String schemaName) {
        columnInfoMap.clear();

        // get schema information and map it to columnInfo
        final List<DefaultColumnInfo> columnInfoList = dao.getColumnInfoList(schemaName);
        for (final DefaultColumnInfo columnInfo : columnInfoList) {
            final String tableName = columnInfo.getTableName();

            if (!columnInfoMap.containsKey(tableName)) {
                columnInfoMap.put(tableName, new HashMap<String, DefaultColumnInfo>());
            }

            columnInfoMap.get(tableName).put(columnInfo.getColumnName(), columnInfo);
        }
    }