Axon JpaSagaStore not consisent

91 Views Asked by At

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?

1

There are 1 best solutions below

5
Steven On BEST ANSWER

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?