def writeStateToDB(self):
<EOL>if not self._dirty:<EOL><INDENT>return True<EOL><DEDENT>self._state['<STR_LIT>'] = time.time()<EOL>newStateJSON = json.dumps(self._state)<EOL>success = self._hsObj._cjDAO.jobSetFieldIfEqual(self._hsObj._jobID,<EOL>'<STR_LIT>', str(newStateJSON), str(self._priorStateJSON))<EOL>if success:<EOL><INDENT>self.logger.debug("<STR_LIT>" %(pprint.pformat(self._state, indent=<NUM_LIT:4>)))<EOL>self._priorStateJSON = newStateJSON<EOL><DEDENT>else:<EOL><INDENT>self.logger.debug("<STR_LIT>" %(pprint.pformat(self._state, indent=<NUM_LIT:4>)))<EOL>self._priorStateJSON = self._hsObj._cjDAO.jobGetFields(self._hsObj._jobID,<EOL>['<STR_LIT>'])[<NUM_LIT:0>]<EOL>self._state =  json.loads(self._priorStateJSON)<EOL>self.logger.info("<STR_LIT>"<EOL>"<STR_LIT>" % (pprint.pformat(self._state, indent=<NUM_LIT:4>)))<EOL><DEDENT>return success<EOL>
Update the state in the job record with our local changes (if any).
        If we don't have the latest state in our priorStateJSON, then re-load
        in the latest state and return False. If we were successful writing out
        our changes, return True

        Parameters:
        ---------------------------------------------------------------------
        retval:    True if we were successful writing out our changes
                   False if our priorState is not the latest that was in the DB.
                   In this case, we will re-load our state from the DB