Applying AggregateDeletedEvent don't affect CachingEventSourcingRepository when there is a cache hit.

Hi All!

When loading a deleted aggregate root from the repository using the CachingEventSourcingRepository and there is a cache hit I don’t get the expected AggregateDeletedException.
On the other hand when there is a cache miss I get the exception when the state is initialized from the event-store. Is this the expected behaviour?

Hi Ted,

What you’re describing is definitely not expected behavior. In my opinion, a cache should never be an excuse for a change in behavior. In other words, it’s a bug.

I can fix it in two ways. First, I can check aggregates loaded from the cache. If they’re deleted, an exception is thrown. The second option is to remove deleted aggregates from the cache. Downside of the second option is that cache misses are more expensive. Does someone have any reasons not to go for the first solution?

Cheers,

Allard

PS. I’ve created issue #180 to track progress on this one.

We are going for the first solution at the moment, I can’t see any reasons why not to.
Great framework btw! Looking forward to the distributed command bus :slight_smile:

20 jul 2011 kl. 09:23 skrev Allard Buijze <buijze@gmail.com>: