SNAPSHOT_EVENT_ENTRY Table empty during parallel aggregate access

We noticed that there could be the situation that the SNAPSHOT_EVENT_ENTRY table could have no
snapshot entries for a specific aggregate in concurrency situations.

We are using DB2 as a database and an Isolation-Level of READ_COMMITTED.
Although the deletion and recreation of SNAPSHOTS is done in one transaction, it seems
to us that another axon instance could see no snapshot at all for a specific aggregate.

That seems to have the effect that an aggregate has to be created by processing all events which
could consume a lot of time and memory.

Has anyone else recognized this effect? We already tried to rise the db isolation level with no success…

Hi,

This may be a database specific ‘feature’. Each implementation seems to have a different way to handle transaction isolations. Taking a look at the documentation about isolation levels in DB2 https://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.5.0/com.ibm.db2.luw.admin.perf.doc/doc/c0004121.html, it strikes me that there doesn’t seem to be support for read committed.

At the moment, Axon deletes snapshots before inserting another one. I think it would be better to insert one first, and delete the older ones after that. That should resolve this issue (as well as some others).

Cheers,

Allard