protected final void lockKeyAndCheckOwnership(InvocationContext ctx, Object key, long lockTimeout, boolean skipLocking) throws InterruptedException {
TxInvocationContext txContext = (TxInvocationContext) ctx;
int transactionTopologyId = -1;
boolean checkForPendingLocks = false;
if (clustered) {
CacheTransaction tx = txContext.getCacheTransaction();
boolean isFromStateTransfer = txContext.isOriginLocal() && ((LocalTransaction)tx).isFromStateTransfer();
// if the transaction is from state transfer it should not wait for the backup locks of other transactions
if (!isFromStateTransfer) {
transactionTopologyId = tx.getTopologyId();
if (transactionTopologyId != TransactionTable.CACHE_STOPPED_TOPOLOGY_ID) {
checkForPendingLocks = txTable.getMinTopologyId() < transactionTopologyId;
}
}
}