question: @ Override public List < ProcessChange > removeSubEquipment ( final Long subEquipmentId , final ConfigurationElementReport subEquipmentReport ) { log . debug ( "Removing SubEquipment " + subEquipmentId ) ; subEquipmentCache . acquireWriteLockOnKey ( subEquipmentId ) ; try { SubEquipment subEquipment = subEquipmentCache . get ( subEquipmentId ) ; List < ProcessChange > changes = removeSubEquipmentTags ( subEquipment , subEquipmentReport ) ; try { changes . addAll ( subEquipmentConfigTransacted . doRemoveSubEquipment ( subEquipment , subEquipmentReport ) ) ; subEquipmentCache . releaseWriteLockOnKey ( subEquipmentId ) ; changes . addAll ( removeEquipmentControlTags ( subEquipment , subEquipmentReport ) ) ; subEquipmentFacade . removeAliveTimer ( subEquipmentId ) ; subEquipmentFacade . removeCommFault ( subEquipmentId ) ; subEquipmentCache . remove ( subEquipmentId ) ; subEquipmentFacade . removeSubEquipmentFromEquipment ( subEquipment . getParentId ( ) , subEquipmentId ) ; return changes ; } catch ( RuntimeException e ) { subEquipmentReport . setFailure ( "Exception caught while removing Sub-equipment " + subEquipmentId ) ; throw new UnexpectedRollbackException ( "Exception caught while removing Sub-equipment" , e ) ; } } catch ( CacheElementNotFoundException e ) { log . debug ( "SubEquipment not found in cache - unable to remove it." , e ) ; subEquipmentReport . setWarning ( "SubEquipment not found in cache so cannot be removed." ) ; return new ArrayList < ProcessChange > ( ) ; } finally { if ( subEquipmentCache . isWriteLockedByCurrentThread ( subEquipmentId ) ) { subEquipmentCache . releaseWriteLockOnKey ( subEquipmentId ) ; } } }
target:  First removes the SubEquipment from the DB and cache. If successful, removes the associated control tags. <p>If an exception is thrown the SubEquipment will be restored in DB (transaction rollback).