Improve performance of DroolsAlarmContext alarm snapshot handling
Description
The current behaviour of the DroolsAlarmContext alarm snapshot handling is to perform a separate DB query for each alarm to find the latest acknowledgment. This can result in an excessive number of DB queries as the number of alarms increases.
This can be improved by doing a single query for all alarms and storing that in memory while the snapshot occurs.
The current behaviour of the DroolsAlarmContext alarm snapshot handling is to perform a separate DB query for each alarm to find the latest acknowledgment. This can result in an excessive number of DB queries as the number of alarms increases.
This can be improved by doing a single query for all alarms and storing that in memory while the snapshot occurs.