I applied your example to my application and it worked:) I have a Runner creating a PurchaseOrder with a command, and then update the PurchaseOrder with 4 other command (resulting in a total of 5 events), I loop this 100000 times, and the first time it took 37 seconds, next time it took 55 seconds, then it took 104 second, and then I got this one:
04 sep 2013 13:00:04 ERROR SimpleCommandBus - Processing of a ConfirmTransportVolumCommand resulted in an exception:
net.sf.ehcache.CacheException: java.io.EOFException
at net.sf.ehcache.store.disk.DiskStorageFactory.retrieve(DiskStorageFactory.java:939)
at net.sf.ehcache.store.disk.Segment.decode(Segment.java:167)
at net.sf.ehcache.store.disk.Segment.put(Segment.java:444)
at net.sf.ehcache.store.disk.DiskStore.put(DiskStore.java:477)
at net.sf.ehcache.store.FrontEndCacheTier.put(FrontEndCacheTier.java:257)
at net.sf.ehcache.Cache.putInternal(Cache.java:1489)
at net.sf.ehcache.Cache.put(Cache.java:1417)
at net.sf.ehcache.Cache.put(Cache.java:1382)
at net.sf.ehcache.jcache.JCache.put(JCache.java:637)
at net.sf.ehcache.jcache.JCache.put(JCache.java:606)
at org.axonframework.eventsourcing.CachingEventSourcingRepository$CacheUpdatingUnitOfWorkListener.afterCommit(CachingEventSourcingRepository.java:152)
at org.axonframework.unitofwork.UnitOfWorkListenerCollection.afterCommit(UnitOfWorkListenerCollection.java:65)
at org.axonframework.unitofwork.DefaultUnitOfWork.notifyListenersAfterCommit(DefaultUnitOfWork.java:230)
at org.axonframework.unitofwork.DefaultUnitOfWork.doCommit(DefaultUnitOfWork.java:145)
at org.axonframework.unitofwork.NestableUnitOfWork.commit(NestableUnitOfWork.java:51)
at org.axonframework.commandhandling.SimpleCommandBus.doDispatch(SimpleCommandBus.java:137)
at org.axonframework.commandhandling.SimpleCommandBus.doDispatch(SimpleCommandBus.java:103)
at org.axonframework.commandhandling.SimpleCommandBus.dispatch(SimpleCommandBus.java:70)
at org.axonframework.commandhandling.gateway.AbstractCommandGateway.sendAndForget(AbstractCommandGateway.java:78)
at org.axonframework.commandhandling.gateway.GatewayProxyFactory$DispatchOnInvocationHandler.invoke(GatewayProxyFactory.java:391)
at org.axonframework.commandhandling.gateway.GatewayProxyFactory$DispatchOnInvocationHandler.invoke(GatewayProxyFactory.java:351)
at org.axonframework.commandhandling.gateway.GatewayProxyFactory$FireAndForget.invoke(GatewayProxyFactory.java:554)
at org.axonframework.commandhandling.gateway.GatewayProxyFactory$NullOnTimeout.invoke(GatewayProxyFactory.java:459)
at org.axonframework.commandhandling.gateway.GatewayProxyFactory$NullOnInterrupted.invoke(GatewayProxyFactory.java:477)
at org.axonframework.commandhandling.gateway.GatewayProxyFactory$WrapNonDeclaredCheckedExceptions.invoke(GatewayProxyFactory.java:434)
at org.axonframework.commandhandling.gateway.GatewayProxyFactory$GatewayInvocationHandler.invoke(GatewayProxyFactory.java:334)
at com.sun.proxy.$Proxy10.send(Unknown Source)
at com.navarsete.stand012.wholesaler.PurchaseOrderRunner.run(PurchaseOrderRunner.java:47)
at com.navarsete.stand012.wholesaler.PurchaseOrderRunner.main(PurchaseOrderRunner.java:30)
Caused by: java.io.EOFException
at java.io.RandomAccessFile.readFully(RandomAccessFile.java:416)
at java.io.RandomAccessFile.readFully(RandomAccessFile.java:394)
at net.sf.ehcache.store.disk.DiskStorageFactory.read(DiskStorageFactory.java:372)
at net.sf.ehcache.store.disk.DiskStorageFactory.retrieve(DiskStorageFactory.java:937)
... 28 more
2055050 in 68 seconds
DETAILS:
So a couple of observations:
1. Using the cache, it's MUCH faster, think I measured the same round without caching and it took nearly 3 minutes! (now 37 seconds, at least the first time).
2. Any clue why it's getting slower and slower, and eventually fails?
Cheers,
Viggo