You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 20, 2023. It is now read-only.
When EventsSubscription processes event, it begins new transaction and then starts executing registered onEvent
callbacks. Then sample onEvent callback publishes command which starts flow CommandHandler -> ApplicationService -> EventRepository.read -> DomainLogic -> EventRepository.write -> EventBus. During EventRepository.write step, the new different transaction begins and commits successfully. If after this transaction next onEvent throws error, the transaction which was started by EventsSubscription is aborted but the changes made by EventRepository.write heve already been persisted. Consequently EventsSubscription is in inconsistent state because currentPosition hasn't changed but some changes of onEvent occured.
Solution
EventRepository.write executed by onEvent callback should use transaction started in EventsSubscription.