question: 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 ; } }
target:  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