@Test public void testStoreTwoExactSameSnapshots() { testSubject.storeSnapshot(createEvent(1)); entityManager.clear(); testSubject.storeSnapshot(createEvent(1)); }
@Override protected void storeSnapshot(DomainEventMessage<?> snapshot, Serializer serializer) { try { entityManager().merge(createSnapshotEntity(snapshot, serializer)); deleteSnapshots(snapshot.getAggregateIdentifier(), snapshot.getSequenceNumber()); if (explicitFlush) { entityManager().flush(); } } catch (Exception e) { handlePersistenceException(e, snapshot); } }
JpaEventStorageEngine extends BatchingEventStorageEngine { @Override protected void storeSnapshot(DomainEventMessage<?> snapshot, Serializer serializer) { try { entityManager().merge(createSnapshotEntity(snapshot, serializer)); deleteSnapshots(snapshot.getAggregateIdentifier(), snapshot.getSequenceNumber()); if (explicitFlush) { entityManager().flush(); } } catch (Exception e) { handlePersistenceException(e, snapshot); } } }
JpaEventStorageEngine extends BatchingEventStorageEngine { @Override protected void storeSnapshot(DomainEventMessage<?> snapshot, Serializer serializer) { try { entityManager().merge(createSnapshotEntity(snapshot, serializer)); deleteSnapshots(snapshot.getAggregateIdentifier(), snapshot.getSequenceNumber()); if (explicitFlush) { entityManager().flush(); } } catch (Exception e) { handlePersistenceException(e, snapshot); } } protected  JpaEventStorageEngine(Builder builder); }
JpaEventStorageEngine extends BatchingEventStorageEngine { @Override protected void storeSnapshot(DomainEventMessage<?> snapshot, Serializer serializer) { try { entityManager().merge(createSnapshotEntity(snapshot, serializer)); deleteSnapshots(snapshot.getAggregateIdentifier(), snapshot.getSequenceNumber()); if (explicitFlush) { entityManager().flush(); } } catch (Exception e) { handlePersistenceException(e, snapshot); } } protected  JpaEventStorageEngine(Builder builder); static Builder builder(); @Override Optional<Long> lastSequenceNumberFor(String aggregateIdentifier); @Override TrackingToken createTailToken(); @Override TrackingToken createHeadToken(); @Override TrackingToken createTokenAt(Instant dateTime); void setGapTimeout(int gapTimeout); void setGapCleaningThreshold(int gapCleaningThreshold); }
JpaEventStorageEngine extends BatchingEventStorageEngine { @Override protected void storeSnapshot(DomainEventMessage<?> snapshot, Serializer serializer) { try { entityManager().merge(createSnapshotEntity(snapshot, serializer)); deleteSnapshots(snapshot.getAggregateIdentifier(), snapshot.getSequenceNumber()); if (explicitFlush) { entityManager().flush(); } } catch (Exception e) { handlePersistenceException(e, snapshot); } } protected  JpaEventStorageEngine(Builder builder); static Builder builder(); @Override Optional<Long> lastSequenceNumberFor(String aggregateIdentifier); @Override TrackingToken createTailToken(); @Override TrackingToken createHeadToken(); @Override TrackingToken createTokenAt(Instant dateTime); void setGapTimeout(int gapTimeout); void setGapCleaningThreshold(int gapCleaningThreshold);  }