Package org.axonframework.unitofwork

Examples of org.axonframework.unitofwork.UnitOfWork.commit()


        repository.commit(loaded);

        Saga load = repository.load(identifier);
        assertNotSame(loaded, load);

        uow.commit();

        // the datasource should only have been asked once
        verify(dataSource, times(1)).getConnection();
    }
View Full Code Here


                                                  eq(false), eq(false),
                                                  any(AMQP.BasicProperties.class), isA(byte[].class));
        verify(transactionalChannel, never()).txCommit();
        verify(transactionalChannel, never()).close();

        uow.commit();
        verify(transactionalChannel).txCommit();
        verify(transactionalChannel).close();
    }

    @Test
View Full Code Here

                                                  any(AMQP.BasicProperties.class), isA(byte[].class));
        verify(transactionalChannel, never()).txCommit();
        verify(transactionalChannel, never()).close();

        try {
            uow.commit();
            fail("Expected exception");
        } catch (EventPublicationFailedException e) {
            assertNotNull(e.getMessage());
        }
        verify(transactionalChannel, never()).txCommit();
View Full Code Here

        UnitOfWork uow = DefaultUnitOfWork.startAndGet();

        testSubject.publish(message);
        verify(channel, never()).waitForConfirms();

        uow.commit();

        verify(channel).confirmSelect();
        verify(channel).basicPublish(eq("mockExchange"), eq("java.lang"),
                                     eq(false), eq(false),
                                     any(AMQP.BasicProperties.class), isA(byte[].class));
View Full Code Here

            returnValue = chain.proceed();
        } catch (Throwable throwable) {
            if (rollbackConfiguration.rollBackOn(throwable)) {
                unitOfWork.rollback(throwable);
            } else {
                unitOfWork.commit();
            }
            throw throwable;
        }

        unitOfWork.commit();
View Full Code Here

                unitOfWork.commit();
            }
            throw throwable;
        }

        unitOfWork.commit();
        return returnValue;
    }

    /**
     * Subscribe the given <code>handler</code> to commands of type <code>commandType</code>. If a subscription already
View Full Code Here

        repository.setEventBus(mockEventBus);

        UnitOfWork uow = DefaultUnitOfWork.startAndGet();
        SimpleAggregateRoot aggregate = new SimpleAggregateRoot();
        repository.add(aggregate);
        uow.commit();

        reset(mockEventBus);
        aggregateIdentifier = aggregate.getIdentifier();
    }
View Full Code Here

                    awaitFor.await();
                    UnitOfWork uow = DefaultUnitOfWork.startAndGet();
                    SimpleAggregateRoot aggregate = repository.load(aggregateIdentifier, null);
                    aggregate.doOperation();
                    aggregate.doOperation();
                    uow.commit();
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                } finally {
                    reportDone.countDown();
                }
View Full Code Here

                uow = unitOfWorkFactory.createUnitOfWork();
                processingResult = doHandle(event);
                if (processingResult.requiresRollback()) {
                    uow.rollback();
                } else {
                    uow.commit();
                }
                if (processingResult.requiresRescheduleEvent()) {
                    eventQueue.addFirst(event);
                } else if (processingResult.isFailure()) {
                    notifyProcessingHandlers();
View Full Code Here

                logger.info("Triggered the publication of event [{}]", eventMessage.getPayloadType().getSimpleName());
            }
            UnitOfWork unitOfWork = unitOfWorkFactory.createUnitOfWork();
            try {
                unitOfWork.publishEvent(eventMessage, eventBus);
                unitOfWork.commit();
            } finally {
                tokens.remove(tokenId);
            }
        }
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.