Examples of PessimisticLockManager


Examples of org.axonframework.repository.PessimisticLockManager

    private List<Thread> startedThreads = new ArrayList<Thread>();
    private static final int CONCURRENT_MODIFIERS = 10;

    @Test(timeout = 60000)
    public void testPessimisticLocking() throws Throwable {
        initializeRepository(new PessimisticLockManager());
        long lastSequenceNumber = executeConcurrentModifications(CONCURRENT_MODIFIERS);

        // with pessimistic locking, all modifications are guaranteed successful
        // note: sequence number 20 means there are 21 events. This includes the one from the setup
        assertEquals(2 * CONCURRENT_MODIFIERS, lastSequenceNumber);
View Full Code Here

Examples of org.axonframework.repository.PessimisticLockManager

     * @param aggregateFactory The factory for new aggregate instances
     * @param eventStore       The event store that holds the event streams for this repository
     * @see org.axonframework.repository.LockingRepository#LockingRepository(Class)
     */
    public CachingEventSourcingRepository(AggregateFactory<T> aggregateFactory, EventStore eventStore) {
        this(aggregateFactory, eventStore, new PessimisticLockManager());
    }
View Full Code Here

Examples of org.axonframework.repository.PessimisticLockManager

        AnnotationCommandHandlerAdapter.subscribe(new CounterCommandHandler(repository), commandBus);
    }

    @Test
    public void testLoopBackKeepsProperEventOrder_PessimisticLocking() {
        initializeRepository(new PessimisticLockManager());
        EventListener el = new EventListener() {
            @Override
            public void handle(EventMessage event) {
                DomainEventMessage domainEvent = (DomainEventMessage) event;
                if (event.getPayload() instanceof CounterChangedEvent) {
View Full Code Here

Examples of org.axonframework.repository.PessimisticLockManager

        verify(eventStore, times(3)).appendEvents(eq("CountingAggregate"), isA(DomainEventStream.class));
    }

    @Test
    public void testLoopBackKeepsProperEventOrder_PessimisticLocking_ProcessingFails() throws Throwable {
        initializeRepository(new PessimisticLockManager());
        EventListener el = new EventListener() {
            @Override
            public void handle(EventMessage event) {
                DomainEventMessage domainEvent = (DomainEventMessage) event;
                if (event.getPayload() instanceof CounterChangedEvent) {
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.