Search code examples
javaaxonaxon-framework

Axon JpaSagaStore not consisent


When I start a Saga and almost immediately after call JpaSagaStore.findSagas it often returns an empty list. Why is that? Should I be using some kind of caching mechanism to solve this?


Solution

  • The chances are high that the UnitOfWork Axon Framework starts hasn't committed yet. Assuming you invoke the findSagas method roughly while the saga event handler is still active.

    Another way of putting it: the transaction isn't done yet, so you're requesting it too soon. I am curious, though, to what end do you need to manually find the saga in the SagaStore?