Examples of IsisTransactionManager


Examples of org.apache.isis.core.runtime.system.transaction.IsisTransactionManager

            allowing(mockAuthenticationSession).getMessageBroker();
            will(returnValue(mockMessageBroker));
        }});

        transactionManager = new IsisTransactionManager(mockPersistenceSession, mockObjectStore, new ServicesInjectorDefault()) {
            @Override
            public AuthenticationSession getAuthenticationSession() {
                return mockAuthenticationSession;
            }
        };
View Full Code Here

Examples of org.apache.isis.core.runtime.system.transaction.IsisTransactionManager

        }
       
        final PersistenceSession persistenceSession =
                new PersistenceSession(persistenceSessionFactory, adapterFactory, servicesInjector, adapterManager, objectStore, getConfiguration());

        final IsisTransactionManager transactionManager = new IsisTransactionManager(persistenceSession, objectStore, servicesInjector);
       
        persistenceSession.setDirtiableSupport(true);
        persistenceSession.setTransactionManager(transactionManager);
       
        return persistenceSession;
View Full Code Here

Examples of org.apache.isis.core.runtime.system.transaction.IsisTransactionManager

            allowing(mockAuthenticationSession).getUserName();
            will(returnValue("sven"));
        }});

       
        transactionManager = new IsisTransactionManager(persistenceSession, mockObjectStore, servicesInjector) {
            @Override
            public AuthenticationSession getAuthenticationSession() {
                return mockAuthenticationSession;
            }
        };
View Full Code Here

Examples of org.apache.isis.core.runtime.system.transaction.IsisTransactionManager

        }
       
    }

    public void commitTran() {
        final IsisTransactionManager transactionManager = getTransactionManager();
        final IsisTransaction transaction = transactionManager.getTransaction();
        if(transaction == null) {
            Assert.fail("No transaction exists");
            return;
        }
        final State state = transaction.getState();
        switch(state) {
            case COMMITTED:
            case ABORTED:
            case MUST_ABORT:
                Assert.fail("Transaction is in state of '" + state + "'");
                break;
            case IN_PROGRESS:
                transactionManager.endTransaction();
                break;
            default:
                Assert.fail("Unknown transaction state '" + state + "'");
        }
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.system.transaction.IsisTransactionManager

                Assert.fail("Unknown transaction state '" + state + "'");
        }
    }

    public void abortTran() {
        final IsisTransactionManager transactionManager = getTransactionManager();
        final IsisTransaction transaction = transactionManager.getTransaction();
        if(transaction == null) {
            Assert.fail("No transaction exists");
            return;
        }
        final State state = transaction.getState();
        switch(state) {
            case ABORTED:
                break;
            case COMMITTED:
                Assert.fail("Transaction is in state of '" + state + "'");
                break;
            case MUST_ABORT:
            case IN_PROGRESS:
                transactionManager.abortTransaction();
                break;
            default:
                Assert.fail("Unknown transaction state '" + state + "'");
        }
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.system.transaction.IsisTransactionManager

    }


   
    public void beginTran() {
        final IsisTransactionManager transactionManager = getTransactionManager();
        final IsisTransaction transaction = transactionManager.getTransaction();

        if(transaction == null) {
            transactionManager.startTransaction();
            return;
        }

        final State state = transaction.getState();
        switch(state) {
            case COMMITTED:
            case ABORTED:
                transactionManager.startTransaction();
                break;
            case IN_PROGRESS:
                // nothing to do
                break;
            case MUST_ABORT:
View Full Code Here

Examples of org.apache.isis.core.runtime.system.transaction.IsisTransactionManager

    @Override
    public void execute(final List<PersistenceCommand> commands) {
        final DatabaseConnector connector = connectionPool.acquire();
        connector.begin();

        final IsisTransactionManager transactionManager = IsisContext.getTransactionManager();
        final MessageBroker messageBroker = IsisContext.getMessageBroker();
        final UpdateNotifier updateNotifier = IsisContext.getUpdateNotifier();
        final SqlExecutionContext context =
            new SqlExecutionContext(connector, transactionManager, messageBroker, updateNotifier);
        try {
View Full Code Here

Examples of org.apache.isis.core.runtime.system.transaction.IsisTransactionManager

   
    protected void doExecute(Object context) {

        final PersistenceSession persistenceSession = getPersistenceSession();
        final IsisTransactionManager transactionManager = getTransactionManager(persistenceSession);
        final List<Command> commands = Lists.newArrayList();
        transactionManager.executeWithinTransaction(new TransactionalClosureAbstract() {
            @Override
            public void execute() {
                commands.addAll(findBackgroundCommandsToExecute());
            }
        });
View Full Code Here

Examples of org.apache.isis.core.runtime.system.transaction.IsisTransactionManager

     * and then calls {@link #doExecuteWithTransaction(Object)}.  Override if you require more sophisticated
     * transaction handling.
     */
    protected void doExecute(final Object context) {
        final PersistenceSession persistenceSession = getPersistenceSession();
        final IsisTransactionManager transactionManager = getTransactionManager(persistenceSession);
        transactionManager.executeWithinTransaction(new TransactionalClosureAbstract() {
            @Override
            public void execute() {
                doExecuteWithTransaction(context);
            }
        });
View Full Code Here

Examples of org.apache.isis.core.runtime.system.transaction.IsisTransactionManager

    }


   
    public void beginTran() {
        final IsisTransactionManager transactionManager = getTransactionManager();
        final IsisTransaction transaction = transactionManager.getTransaction();

        if(transaction == null) {
            startTransactionForUser(transactionManager);
            return;
        }
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.