def _checkForOrphanedModels (self):
self.logger.debug("<STR_LIT>" %(self._modelOrphanIntervalSecs))<EOL>while True:<EOL><INDENT>orphanedModelId = self._cjDAO.modelAdoptNextOrphan(self._jobID,<EOL>self._modelOrphanIntervalSecs)<EOL>if orphanedModelId is None:<EOL><INDENT>return<EOL><DEDENT>self.logger.info("<STR_LIT>" % (orphanedModelId))<EOL>for attempt in range(<NUM_LIT:100>):<EOL><INDENT>paramsHash = hashlib.md5("<STR_LIT>" % (orphanedModelId,<EOL>attempt)).digest()<EOL>particleHash = hashlib.md5("<STR_LIT>" % (orphanedModelId,<EOL>attempt)).digest()<EOL>try:<EOL><INDENT>self._cjDAO.modelSetFields(orphanedModelId,<EOL>dict(engParamsHash=paramsHash,<EOL>engParticleHash=particleHash))<EOL>success = True<EOL><DEDENT>except:<EOL><INDENT>success = False<EOL><DEDENT>if success:<EOL><INDENT>break<EOL><DEDENT><DEDENT>if not success:<EOL><INDENT>raise RuntimeError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>self._cjDAO.modelSetCompleted(modelID=orphanedModelId,<EOL>completionReason=ClientJobsDAO.CMPL_REASON_ORPHAN,<EOL>completionMsg="<STR_LIT>")<EOL>self._resultsDB.update(modelID=orphanedModelId,<EOL>modelParams=None,<EOL>modelParamsHash=paramsHash,<EOL>metricResult=None,<EOL>completed = True,<EOL>completionReason = ClientJobsDAO.CMPL_REASON_ORPHAN,<EOL>matured = True,<EOL>numRecords = <NUM_LIT:0>)<EOL><DEDENT>
If there are any models that haven't been updated in a while, consider
        them dead, and mark them as hidden in our resultsDB. We also change the
        paramsHash and particleHash of orphaned models so that we can
        re-generate that particle and/or model again if we desire.

        Parameters:
        ----------------------------------------------------------------------
        retval: