/** * {@inheritDoc} * The assumption here is two transactions are still equal if they have the same transaction manager * and the same transaction id, regardless of whether one is or is not nested. */ public boolean equals(final Object other) { return super.equals(other); } }
@SuppressWarnings("SimplifiableIfStatement") @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AbstractTransactionReplicationPacketData that = (AbstractTransactionReplicationPacketData) o; if (_weight != that._weight) return false; if (_flags != that._flags) return false; if (_metaData != null ? !_metaData.equals(that._metaData) : that._metaData != null) return false; return _transaction != null ? _transaction.equals(that._transaction) : that._transaction == null; } }
/** * given an entry and a template, return true if read-committed should be performed should be * called when xtn & entry are locked (but called from count w/o locks in order not to harm * performance */ private boolean indicateReadCommitted(ITransactionalEntryData entry, ITemplateHolder template) { if (indicateDirtyRead(template) || !template.isReadCommittedRequested()) return false; ServerTransaction est = entry.getWriteLockTransaction(); if (template.getXidOriginatedTransaction() != null && est != null && template.getXidOriginatedTransaction().equals(est)) //if both entry & template under same xtn, its not read committed return false; return true; }
|| entryHolder.isTransient() || entryHolder.getWriteLockTransaction() == null || !entryHolder.getWriteLockTransaction().equals(xtn)) continue;
private void insertTransactionMarkerToRepository(IMarker marker, List<IEntryHolder> pLocked, ServerTransaction transaction) { if (pLocked == null) return; for (IEntryHolder entryHolder : pLocked) { if (entryHolder == null) continue; if (entryHolder.getWriteLockTransaction() == null || !entryHolder.getWriteLockTransaction() .equals(transaction)) continue; int op = entryHolder.getWriteLockOperation(); if (op != SpaceOperations.WRITE && op != SpaceOperations.UPDATE && op != SpaceOperations.TAKE && op != SpaceOperations.TAKE_IE) continue; getEvictionReplicationsMarkersRepository().insert(entryHolder.getUID(), marker, false /*alreadyLocked*/); } }
if (entryHolder == null || entryHolder.isDeleted() || entryHolder.getWriteLockTransaction() == null || !entryHolder.getWriteLockTransaction().equals(xtn)) continue;
!edata.getWriteLockTransaction().equals(template.getXidOriginatedTransaction())) // template is under Xtn || (entryReadLockStatus == XtnStatus.ROLLING && !xtnEntry.m_AlreadyPrepared)) continue; if (template.getXidOriginatedTransaction() == null || !readLockOwner.m_Transaction.equals(template.getXidOriginatedTransaction())) return XtnConfilctCheckIndicators.XTN_CONFLICT; //new TransactionConflictException(readLockOwner.m_Transaction, template.getXidOriginatedTransaction()); !entry.getWriteLockTransaction().equals(template.getXidOriginatedTransaction())) // template is under Xtn continue; if (template.getXidOriginatedTransaction() == null || !readLockOwner.m_Transaction.equals(template.getXidOriginatedTransaction())) return XtnConfilctCheckIndicators.XTN_CONFLICT;//new TransactionConflictException(readLockOwner.m_Transaction, template.getXidOriginatedTransaction()); !entry.getWriteLockTransaction().equals(template.getXidOriginatedTransaction())) { return checkTransactionConflict(xtnEntry, entryWriteLockStatus, entryWriteLockOperation);
int lockType, operType; ServerTransaction writeLockOwner = entry.getWriteLockTransaction(); if ((writeLockOwner == null) || (!writeLockOwner.equals(txn))) { lockType = UnderTxnLockedObject.LOCK_TYPE_READ_LOCK; operType = SpaceOperations.READ;
if (pEntry.getEntryHolder(this).getXidOriginatedTransaction() == null || !pEntry.getEntryHolder(this).getXidOriginatedTransaction().equals(pEntry.getEntryHolder(this).getWriteLockTransaction())) pXtn = pEntry.getEntryHolder(this).getWriteLockOwner().getXtnData(); if (pXtn != null) {
.equals(transaction)) continue;
ServerTransaction sv = currentEh != null ? currentEh.getWriteLockTransaction() : null; if (sv != null && (currentEh.getWriteLockOperation() == SpaceOperations.TAKE_IE || currentEh.getWriteLockOperation() == SpaceOperations.TAKE) && sv.equals(txnEntry.m_Transaction)) {
return null; } catch (TransactionNotActiveException tnae) { if (template.getXidOriginatedTransaction() != null && tnae.m_Xtn.equals(template.getXidOriginatedTransaction())) throw new TransactionException("Transaction not active " + tnae.m_Xtn, tnae);
case SpaceOperations.READ_IE: if (pEntry.getEntryHolder(this).getWriteLockTransaction() == null || !pEntry.getEntryHolder(this).getWriteLockTransaction().equals(xtnEntry.m_Transaction)) { if (pEntry.getEntryHolder(this).getWriteLockOperation() == SpaceOperations.UPDATE && pEntry.getEntryHolder(this).getWriteLockTransaction().equals(xtnEntry.m_Transaction)) restoreShadowValues = true; if (pEntry.getEntryHolder(this).getWriteLockOperation() == SpaceOperations.WRITE && pEntry.getEntryHolder(this).getWriteLockTransaction() != null && pEntry.getEntryHolder(this).getWriteLockTransaction().equals(xtnEntry.m_Transaction)) newShadow = false; pEntry.getEntryHolder(this).getWriteLockTransaction().equals(xtnEntry.m_Transaction) && pEntry.getEntryHolder(this).hasShadow()) newShadow = false; pEntry.getEntryHolder(this).getWriteLockOperation() == SpaceOperations.TAKE_IE) && pEntry.getEntryHolder(this).getWriteLockTransaction() != null && pEntry.getEntryHolder(this).getWriteLockTransaction().equals(xtnEntry.m_Transaction))
return null; } catch (TransactionNotActiveException ex) { if (ex.m_Xtn.equals(template.getXidOriginatedTransaction())) throw new TransactionException("Transaction not active : " + template.getXidOriginatedTransaction()); return null;
return; } catch (TransactionNotActiveException ex) { if (ex.m_Xtn.equals(template.getXidOriginatedTransaction())) throw new TransactionException("Transaction not active : " + template.getXidOriginatedTransaction(), ex);
if (template.getXidOriginatedTransaction() != null && template.getXidOriginatedTransaction().equals(entry.getWriteLockTransaction()))
!template.getXidOriginatedTransaction().equals(entry.getXidOriginatedTransaction())) _cacheManager.associateEntryWithXtn(context, entry, template, template.getXidOriginated(), null); if ((template.getXidOriginatedTransaction() == null) || (entry.getXidOriginatedTransaction() != null && template.getXidOriginatedTransaction().equals(entry.getXidOriginatedTransaction()))) {
template.getXidOriginatedTransaction().equals(entry.getWriteLockTransaction())) { reWrittenUnderXtn = true; //take + write under xtn