RADAR-base / RADAR-Appserver

General purpose application server for the radar platform currently with capability to schedule push notifications
Apache License 2.0
10 stars 1 forks source link

Use async processing to avoid database timeouts #437

Closed blootsvoets closed 11 months ago

blootsvoets commented 1 year ago

In the previous handling of events, event were handled immediately during the transaction, in the same thread. This caused a lot of delays, blocking the database threads. The EventListener annotations are replaced by TransactionalEventListener annotations to ensure that the previous transaction has been committed before processing the event. It explicitly creates a new transaction to avoid overlapping transactions. Finally, the Async annotation enables async processing to avoid the existing transaction threads being blocked.

This fixes an issue that caused timeouts if the fcm handling had timeouts.