returns false if another committed session has altered the same row
327011
synchronized boolean canCommit(Session session, OrderedHashSet set) {

        RowActionBase action;
        long          timestamp       = session.transactionTimestamp;
        long          commitTimestamp = 0;
        final boolean readCommitted = session.isolationMode
                                      == SessionInterface.TX_READ_COMMITTED;

        action = this;

        if (readCommitted) {
            do {
                if (action.session == session) {

                    // for READ_COMMITTED, use action timestamp for later conflicts
                    if (action.commitTimestamp == 0) {
                        timestamp = action.actionTimestamp;
                    }
                }

                action = action.next;
            } while (action != null);

            action = this;
        }

        do {
            if (action.rolledback || action.type == ACTION_NONE) {
                action = action.next;

                continue;
            }

            if (action.session != session) {
                if (action.prepared) {
                    return false;
                }

                if (action.commitTimestamp == 0
                        && action.actionTimestamp != 0) {
                    set.add(action.session);
                } else if (action.commitTimestamp > commitTimestamp) {
                    commitTimestamp = action.commitTimestamp;
                }
            }

            action = action.next;
        } while (action != null);

        return commitTimestamp < timestamp;
    }
474219
def exists(self, primary_key):
        
        '''
            
        '''
        
        select_statement = self.table.select(self.table).where(self.table.c.id==primary_key)
        record_object = self.session.execute(select_statement).first()
        if record_object:
            return True
        return False
124779
final public function valuesHadChanged(): bool
    {
        if (! is_array($this->originalValues)) {
            throw new \RuntimeException('The recordset does not contain any original values');
        }
        foreach ($this->originalValues as $field => $value) {
            $current = array_key_exists($field, $this->values) ? $this->values[$field] : null;
            if ($this->valueIsDifferent($value, $current)) {
                return true;
            }
        }
        return false;
    }
1196676
private boolean hasHashChanged(Set<RegData> regData) {
        for (RegData el : regData) {
            if (hasHashChanged(mHasher, el)) {
                return true;
            }
        }
        return false;
    }
329756
private boolean hasChanged( int[] oldValue, int[] newValue ) {
        if( oldValue.length == newValue.length ) {
            for( int i = 0; i < newValue.length; i++ ) {
                if( oldValue[i] != newValue[i] ) {
                    return true;
                }
            }
            return false;
        }
        return true;
    }
962527
def update_changes_after_row_delete(self, row_num):
        
        if row_num in self.changes.copy():
            self.changes.remove(row_num)
        updated_rows = []
        for changed_row in self.changes:
            if changed_row == -1:
                updated_rows.append(-1)
            if changed_row > row_num:
                updated_rows.append(changed_row - 1)
            if changed_row < row_num:
                updated_rows.append(changed_row)
        self.changes = set(updated_rows)
1105385
synchronized void rollback(Session session, long timestamp) {

        RowActionBase action = this;

        do {
            if (action.session == session && action.commitTimestamp == 0) {
                if (action.actionTimestamp >= timestamp
                        || action.actionTimestamp == 0) {
                    action.commitTimestamp = session.actionTimestamp;
                    action.rolledback      = true;
                    action.prepared        = false;
                }
            }

            action = action.next;
        } while (action != null);
    }
155772
public boolean hasChanges() {
        for (Map.Entry<Object, DocumentInfo> entity : documentsByEntity.entrySet()) {
            ObjectNode document = entityToJson.convertEntityToJson(entity.getKey(), entity.getValue());
            if (entityChanged(document, entity.getValue(), null)) {
                return true;
            }
        }

        return !deletedEntities.isEmpty();
    }
1366475
void checkInsert(Session session, Table table, Object[] row) {

        switch (constType) {

            case CHECK :
                if (!isNotNull) {
                    checkCheckConstraint(session, table, row);
                }

                return;

            case FOREIGN_KEY :
                PersistentStore store =
                    session.sessionData.getRowStore(core.mainTable);

                if (ArrayUtil.hasNull(row, core.refCols)) {
                    if (core.matchType == OpTypes.MATCH_SIMPLE) {
                        return;
                    }

                    if (core.refCols.length == 1) {
                        return;
                    }

                    if (ArrayUtil.hasAllNull(row, core.refCols)) {
                        return;
                    }

                    // core.matchType == OpTypes.MATCH_FULL
                } else if (core.mainIndex.exists(session, store, row,
                                                 core.refCols)) {
                    return;
                } else if (core.mainTable == core.refTable) {

                    // special case: self referencing table and self referencing row
                    int compare = core.mainIndex.compareRowNonUnique(row,
                        core.refCols, row);

                    if (compare == 0) {
                        return;
                    }
                }

                String[] info = new String[] {
                    core.refName.name, core.mainTable.getName().name
                };

                throw Error.error(ErrorCode.X_23502, ErrorCode.CONSTRAINT,
                                  info);
        }
    }
147238
public boolean checkModified(LightFileDescriptor other) {
        if (isAlwaysModified() || other.isAlwaysModified())
            return true;

        if (!name.equals(other.name))
            return true;

        if (!(hasChecksum() && other.hasChecksum()) && !(hasModificationDate() && other.hasModificationDate()))
            // No intersecting characteristics, cant compare => file is modified
            return true;

        if (hasChecksum() && other.hasChecksum() && !Arrays.equals(checksum, other.checksum))
            return true;

        if (hasModificationDate() && other.hasModificationDate() && !lastModified.equals(other.lastModified))
            return true;

        return false;
    }
808548
def changed?
      return false unless loaded?
      return true if added.length > 0
      return true if removed.length > 0
      false
    end
1253673
private static boolean isChanged(byte[] bytes, String filepath) throws IOException {
        return isChanged(bytes, bytes.length,  filepath);
    }
942510
protected void compareTransferParams(Session other) throws ClientException {
        if (!this.authorized || !other.authorized)
            throw new ClientException(ClientException.NOT_AUTHORIZED,
                    "Need to perform authorization first");

        // synchronize protection buffer size
        if (this.protectionBufferSize != other.protectionBufferSize) {
            throw new ClientException(ClientException.PBSZ_DIFFER);
        }
        // synchronize type
        if (this.transferType != other.transferType) {
            throw new ClientException(ClientException.TRANSFER_TYPE_DIFFER);
        }
        // synchronize type
        if (this.transferMode != other.transferMode) {
            throw new ClientException(ClientException.TRANSFER_MODE_DIFFER);
        }
    }
1270913
def hasUnsavedChanges(self):
        

        # Sanity check - this case shouldn't occur
        assert self._lastSavedState is not None, \
               "BUG: Please report this as it should never occur."

        # Force the current GUI values into our model in memory, but don't
        # change anything.  Don't save to file, don't even convert bad
        # values to their previous state in the gui.  Note that this can
        # leave the GUI in a half-saved state, but since we are about to exit
        # this is OK.  We only want prompting to occur if they decide to save.
        badList = self.checkSetSaveEntries(doSave=False, fleeOnBadVals=True,
                                           allowGuiChanges=False)
        if badList:
            return True

        # Then compare our data to the last known saved state.  MAKE SURE
        # the LHS is the actual dict (and not 'self') to invoke the dict
        # comparison only.
        return self._lastSavedState != self._taskParsObj
987916
public function isChanged()
    {
        // When unbound, use the local changed flag
        if (! ($this->record instanceof DataObject)) {
            return $this->isChanged;
        }

        // Defer to parent record
        foreach ($this->compositeDatabaseFields() as $field => $spec) {
            $key = $this->getName() . $field;
            if ($this->record->isChanged($key)) {
                return true;
            }
        }
        return false;
    }
1043288
private boolean previousZKSessionStillActive()
    {
        try {
            byte[] json = zk.get().getData(String.format("/%s/nodes/%s", name, myNodeID), false, null);
            NodeInfo nodeInfo = JsonUtil.fromJSON(json, NodeInfo.class);
            return (nodeInfo.connectionID == zk.get().getSessionId());
        } catch (NoNodeException e) {
            ; // apparently harmless?
        } catch (Exception e) {
            LOG.error("Encountered unexpected error in checking ZK session status.", e);
        }
        return false;
    }
825520
def nested_records_changed_for_autosave?
        @_nested_records_changed_for_autosave_already_called ||= false
        return false if @_nested_records_changed_for_autosave_already_called
        begin
          @_nested_records_changed_for_autosave_already_called = true
          self.class._reflections.values.any? do |reflection|
            if reflection.options[:autosave]
              association = association_instance_get(reflection.name)
              association && Array.wrap(association.target).any?(&:changed_for_autosave?)
            end
          end
        ensure
          @_nested_records_changed_for_autosave_already_called = false
        end
      end