@Override @Transactional(value="cacheTransactionManager",propagation=Propagation.REQUIRES_NEW) public void doUpdateAlarm(final Long alarmId,final Properties properties){
  if (properties.containsKey("dataTagId")) {
    LOGGER.warn("Attempting to change the tag to which an alarm is attached - this is not currently supported!");
    properties.remove("dataTagId");
  }
  alarmCache.acquireWriteLockOnKey(alarmId);
  try {
    Alarm alarm=alarmCache.getCopy(alarmId);
    alarmFacade.updateConfig(alarm,properties);
    alarmDAO.updateConfig(alarm);
    alarmCache.putQuiet(alarm);
  }
 catch (  CacheElementNotFoundException ex) {
    throw ex;
  }
catch (  Exception ex) {
    LOGGER.error("Exception caught while updating alarm" + alarmId,ex);
    throw new UnexpectedRollbackException("Unexpected exception caught while updating Alarm " + alarmId,ex);
  }
 finally {
    alarmCache.releaseWriteLockOnKey(alarmId);
  }
}

@ Override @ Transactional ( value = "cacheTransactionManager" , propagation = Propagation . REQUIRES_NEW ) public void doUpdateAlarm ( final Long alarmId , final Properties properties ) { if ( properties . containsKey ( "dataTagId" ) ) { LOGGER . warn ( "Attempting to change the tag to which an alarm is attached - this is not currently supported!" ) ; properties . remove ( "dataTagId" ) ; } alarmCache . acquireWriteLockOnKey ( alarmId ) ; try { Alarm alarm = alarmCache . getCopy ( alarmId ) ; alarmFacade . updateConfig ( alarm , properties ) ; alarmDAO . updateConfig ( alarm ) ; alarmCache . putQuiet ( alarm ) ; } catch ( CacheElementNotFoundException ex ) { throw ex ; } catch ( Exception ex ) { LOGGER . error ( "Exception caught while updating alarm" + alarmId , ex ) ; throw new UnexpectedRollbackException ( "Unexpected exception caught while updating Alarm " + alarmId , ex ) ; } finally { alarmCache . releaseWriteLockOnKey ( alarmId ) ; } }
updates the alarm object in the server from the provided properties . in more detail , updates the cache , then the db . < p > note that moving the alarm to a different tag is not allowed . in this case the alarm should be removed and recreated .
