Examples of ConcurrencyException


Examples of org.axonframework.repository.ConcurrencyException

        final DBObject dbObject = storageStrategy.createDocuments(type, eventSerializer,
                                                                  Collections.singletonList(snapshotEvent))[0];
        try {
            mongoTemplate.snapshotEventCollection().insert(dbObject);
        } catch (MongoException.DuplicateKey e) {
            throw new ConcurrencyException("Trying to insert a SnapshotEvent with aggregate identifier and sequence "
                                                   + "number that is already present in the Event Store", e);
        }
        if (logger.isDebugEnabled()) {
            logger.debug("snapshot event of type {} appended.");
        }
View Full Code Here

Examples of org.axonframework.repository.ConcurrencyException

    @Test
    public void testScheduleSnapshot_ConcurrencyExceptionIsSilenced()
            throws NoSuchFieldException, IllegalAccessException {
        final Object aggregateIdentifier = "aggregateIdentifier";
        doNothing()
                .doThrow(new ConcurrencyException("Mock"))
                .when(mockEventStore).appendSnapshotEvent(eq("test"), isA(DomainEventMessage.class));
        when(mockEventStore.readEvents("test", aggregateIdentifier))
                .thenAnswer(new Answer<Object>() {
                    @Override
                    public Object answer(InvocationOnMock invocationOnMock) throws Throwable {
View Full Code Here

Examples of org.axonframework.repository.ConcurrencyException

    // trigger retry
        commandBus.subscribe(String.class.getName(), new CommandHandler<String>() {
            @Override
            public Object handle(CommandMessage<String> commandMessage, UnitOfWork unitOfWork) throws Throwable {
                throw new ConcurrencyException("some retryable exception");
            }
        });

        // say we have a dispatch interceptor that expects to get the user's session from a ThreadLocal...
        // yes, this should be configured on the gateway instead of the command bus, but still...
View Full Code Here

Examples of org.axonframework.repository.ConcurrencyException

      // trigger retry, then return metadata for verification
        commandBus.subscribe(String.class.getName(), new CommandHandler<String>() {
            @Override
            public MetaData handle(CommandMessage<String> commandMessage, UnitOfWork unitOfWork) throws Throwable {
              if (Thread.currentThread() == testThread) {
                throw new ConcurrencyException("some retryable exception");
              } else {
                return commandMessage.getMetaData();
              }
            }
        });
View Full Code Here

Examples of org.axonframework.repository.ConcurrencyException

      // trigger retry, then return metadata for verification
        commandBus.subscribe(String.class.getName(), new CommandHandler<String>() {
            @Override
            public MetaData handle(CommandMessage<String> commandMessage, UnitOfWork unitOfWork) throws Throwable {
              if (Thread.currentThread() == testThread) {
                throw new ConcurrencyException("some retryable exception");
              } else {
                return commandMessage.getMetaData();
              }
            }
        });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.