private synchronized void storeTimestampAndSetStatus(Timestamper.TimestampSucceeded message,TimestampRecord timestampRecord) throws Exception {
  try {
    persistTimestampRecord(message,timestampRecord);
    setTimestampSucceeded();
  }
 catch (  Exception e) {
    log.error("Failed to save time-stamp record to database",e);
    setTimestampFailedRegardlessOfQueue(new DateTime());
    throw e;
  }
}

private synchronized void storeTimestampAndSetStatus ( Timestamper . TimestampSucceeded message , TimestampRecord timestampRecord ) throws Exception { try { persistTimestampRecord ( message , timestampRecord ) ; setTimestampSucceeded ( ) ; } catch ( Exception e ) { log . error ( "Failed to save time-stamp record to database" , e ) ; setTimestampFailedRegardlessOfQueue ( new DateTime ( ) ) ; throw e ; } }
stores timestamped records , and sets status to succeeded if everything went as expected . this method is synchronized so that these two operations are executed atomically and do not disturb each other : 1 ) storetimestampandsetstatus : stores timestamp records and sets status 2 ) settimestampfailed : reads status , checks existence of unstamped records and sets status
