Hi there,
I’m using Axon 4.5.3 with Axon Server SE 4.5.6, using Spring Data to manage my read model.
I’m facing an odd issue when replaying my events with a “traditional” tracking processor (not the pooled one).
Increasing/decreasing the segments/threads don’t change anything. The batch size is the default one, 1.
I have a bunch of events whose timestamps are really close as they have been generated by a data import process. The sequencing policy is the default one as well, using the aggregate id.
Let’s talk about the events replaying now.
The first event will trigger the creation of an entry with partial data that will be updated by the handling of the next event. Later on, new entries will be created using the first one as a template.
The issue I’m facing now is that this first entry is not always found (I throw an error in that case that will put the TP in error mode as I change the default error handler logic).
I suspected this could happen with a batch size > 1 as we might one single transaction for the whole batch, but not in the current case. I’m not sure if this related to Hibernate optimization itself or Axon but I’m still looking for clues.
When I debug the @EventHandler
where I expect to find the previous template entry, I can confirm this previous record is not (yet) in the database. Then I tried to disable this @EventHandler
completely and replay the TP with only the @EventHandler
creating the first entry enabled, and in that case, I can find the records in the database.
It really looks like the transaction is not committed when expected, or at least delayed enough to make the look up failing when the next event is processed.
Are you aware of any reason that could explain this behavior ? I’m trying to set up a datasource-proxy to be able to selectively log what I need for debugging but this is time consuming.
Thank you,
Cheers,
Jerome