fullRuntime/src/sc/db/DBObject.java
void applyUpdates(DBTransaction transaction, ArrayList<PropUpdate> updateList, DBPropertyDescriptor versProp, long newVersion,
                     DBPropertyDescriptor lastModifiedProp, Date lmtValue) {
      synchronized (pendingOps) {
         transaction.commitInProgress = true;
         if (transaction.commitTime == -1)
            transaction.commitTime = System.currentTimeMillis();
         instanceLastUsed = transaction.commitTime;
         try {
            IDBObject inst = getInst();
            boolean needsValidate = inst instanceof IPropValidator;
            boolean errorsChanged = false;
            Map<String,String> propErrors = needsValidate ? ((IPropValidator) inst).getPropErrors() : null;
            Map<String,String> newPropErrors = null;
            for (PropUpdate propUpdate:updateList) {
               DBPropertyDescriptor prop = propUpdate.prop;
               Object newVal = propUpdate.value;
               String propName = prop.propertyName;
               if (needsValidate && prop.hasValidator()) {
                  String err = propUpdate.prop.validate(this, newVal);
                  if (err == null) {
                     if (propErrors != null) {
                        if (newPropErrors == null)
                           newPropErrors = new TreeMap<String,String>(propErrors);
                        newPropErrors.remove(propName);
                        errorsChanged = true;
                     }
                  }
                  else {
                     if (propErrors != null) {
                        String oldError = propErrors.get(propName);
                        if (!StringUtil.equalStrings(oldError, err)) {
                           if (newPropErrors == null)
                              newPropErrors = new TreeMap<String,String>(propErrors);
                           newPropErrors.put(propName, err);
                           errorsChanged = true;
                        }
                     }
                     else {
                        newPropErrors = new TreeMap<String,String>();
                        newPropErrors.put(propName, err);
                        errorsChanged = true;
                     }
                  }
               }
               propUpdate.prop.getPropertyMapper().setPropertyValue(inst, newVal);
            }
            if (versProp != null)
               versProp.getPropertyMapper().setPropertyValue(inst, newVersion);
            if (lastModifiedProp != null && lmtValue != null)
               lastModifiedProp.getPropertyMapper().setPropertyValue(inst, lmtValue);
            if (errorsChanged)
               ((IPropValidator) inst).setPropErrors(newPropErrors.size() == 0 ? null : newPropErrors);
         }
         finally {
            transaction.commitInProgress = false;
         }
      }
   }
/** Called once the database has been updated with the changes. Updates the cached values in this instance. */
Called once the database has been updated with the changes. Updates the cached values in this instance.
Called once the database has been updated with the changes . Updates the cached values in this instance .
void applyUpdates(DBTransaction transaction, ArrayList<PropUpdate> updateList, DBPropertyDescriptor versProp, long newVersion,
                     DBPropertyDescriptor lastModifiedProp, Date lmtValue) {
      synchronized (pendingOps) {
         transaction.commitInProgress = true;
         if (transaction.commitTime == -1)
            transaction.commitTime = System.currentTimeMillis();
         instanceLastUsed = transaction.commitTime;
         try {
            IDBObject inst = getInst();
            boolean needsValidate = inst instanceof IPropValidator;
            boolean errorsChanged = false;
            Map<String,String> propErrors = needsValidate ? ((IPropValidator) inst).getPropErrors() : null;
            Map<String,String> newPropErrors = null;
            for (PropUpdate propUpdate:updateList) {
               DBPropertyDescriptor prop = propUpdate.prop;
               Object newVal = propUpdate.value;
               String propName = prop.propertyName;
               if (needsValidate && prop.hasValidator()) {
                  String err = propUpdate.prop.validate(this, newVal);
                  if (err == null) {
                     if (propErrors != null) {
                        if (newPropErrors == null)
                           newPropErrors = new TreeMap<String,String>(propErrors);
                        newPropErrors.remove(propName);
                        errorsChanged = true;
                     }
                  }
                  else {
                     if (propErrors != null) {
                        String oldError = propErrors.get(propName);
                        if (!StringUtil.equalStrings(oldError, err)) {
                           if (newPropErrors == null)
                              newPropErrors = new TreeMap<String,String>(propErrors);
                           newPropErrors.put(propName, err);
                           errorsChanged = true;
                        }
                     }
                     else {
                        newPropErrors = new TreeMap<String,String>();
                        newPropErrors.put(propName, err);
                        errorsChanged = true;
                     }
                  }
               }
               propUpdate.prop.getPropertyMapper().setPropertyValue(inst, newVal);
            }
            if (versProp != null)
               versProp.getPropertyMapper().setPropertyValue(inst, newVersion);
            if (lastModifiedProp != null && lmtValue != null)
               lastModifiedProp.getPropertyMapper().setPropertyValue(inst, lmtValue);
            if (errorsChanged)
               ((IPropValidator) inst).setPropErrors(newPropErrors.size() == 0 ? null : newPropErrors);
         }
         finally {
            transaction.commitInProgress = false;
         }
      }
   }
void applyUpdates ( DBTransaction transaction , ArrayList < PropUpdate > updateList , DBPropertyDescriptor versProp , long newVersion , DBPropertyDescriptor lastModifiedProp , Date lmtValue ) { synchronized ( pendingOps ) { transaction . commitInProgress = true ; if ( transaction . commitTime == - 1 ) transaction . commitTime = System . currentTimeMillis ( ) ; instanceLastUsed = transaction . commitTime ; try { IDBObject inst = getInst ( ) ; boolean needsValidate = inst instanceof IPropValidator ; boolean errorsChanged = false ; Map < String , String > propErrors = needsValidate ? ( ( IPropValidator ) inst ) . getPropErrors ( ) : null ; Map < String , String > newPropErrors = null ; for ( PropUpdate propUpdate : updateList ) { DBPropertyDescriptor prop = propUpdate . prop ; Object newVal = propUpdate . value ; String propName = prop . propertyName ; if ( needsValidate && prop . hasValidator ( ) ) { String err = propUpdate . prop . validate ( this , newVal ) ; if ( err == null ) { if ( propErrors != null ) { if ( newPropErrors == null ) newPropErrors = new TreeMap < String , String > ( propErrors ) ; newPropErrors . remove ( propName ) ; errorsChanged = true ; } } else { if ( propErrors != null ) { String oldError = propErrors . get ( propName ) ; if ( ! StringUtil . equalStrings ( oldError , err ) ) { if ( newPropErrors == null ) newPropErrors = new TreeMap < String , String > ( propErrors ) ; newPropErrors . put ( propName , err ) ; errorsChanged = true ; } } else { newPropErrors = new TreeMap < String , String > ( ) ; newPropErrors . put ( propName , err ) ; errorsChanged = true ; } } } propUpdate . prop . getPropertyMapper ( ) . setPropertyValue ( inst , newVal ) ; } if ( versProp != null ) versProp . getPropertyMapper ( ) . setPropertyValue ( inst , newVersion ) ; if ( lastModifiedProp != null && lmtValue != null ) lastModifiedProp . getPropertyMapper ( ) . setPropertyValue ( inst , lmtValue ) ; if ( errorsChanged ) ( ( IPropValidator ) inst ) . setPropErrors ( newPropErrors . size ( ) == 0 ? null : newPropErrors ) ; } finally { transaction . commitInProgress = false ; } } }
Called once the database has been updated with the changes.
Called once the database has been updated with the changes .