@Override
protected void checkReferencing(Session session, Index index, FDBStoreData storeData,
RowData row, ForeignKey foreignKey, String operation) {
assert index.isUnique() : index;
TransactionState txn = txnService.getTransaction(session);
FDBPendingIndexChecks.CheckPass finalPass =
txn.isDeferred(foreignKey) ?
FDBPendingIndexChecks.CheckPass.TRANSACTION :
FDBPendingIndexChecks.CheckPass.ROW;
FDBPendingIndexChecks.PendingCheck<?> check =
FDBPendingIndexChecks.foreignKeyReferencingCheck(session, txn, index, storeData.persistitKey,
foreignKey, finalPass, operation);
if (txn.getForceImmediateForeignKeyCheck() ||
((finalPass == FDBPendingIndexChecks.CheckPass.ROW) &&
((txn.getIndexChecks(false) == null) || !txn.getIndexChecks(false).isDelayed()))) {
check.blockUntilReady(txn);
if (!check.check(session, txn, index)) {
notReferencing(session, index, storeData, row, foreignKey, operation);
}
}
else {
txn.getIndexChecks(true).add(session, txn, index, check);
}
}