public void touchPost ( final long postId , final TimeZone tz ) throws SQLException { if ( postId < 1L ) { throw new SQLException ( "The post id must be specified for update" ) ; } long modifiedTimestamp = System . currentTimeMillis ( ) ; int offset = tz . getOffset ( modifiedTimestamp ) ; Connection conn = null ; PreparedStatement stmt = null ; Timer . Context ctx = metrics . updatePostTimer . time ( ) ; try { conn = connectionSupplier . getConnection ( ) ; stmt = conn . prepareStatement ( updatePostModifiedSQL ) ; stmt . setTimestamp ( 1 , new Timestamp ( modifiedTimestamp ) ) ; stmt . setTimestamp ( 2 , new Timestamp ( modifiedTimestamp - offset ) ) ; stmt . setLong ( 3 , postId ) ; stmt . executeUpdate ( ) ; } finally { ctx . stop ( ) ; SQLUtil . closeQuietly ( conn , stmt ) ; } }
Touches the last modified time for a post .