Examples of IsisTransaction


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

        withLogging(pojo, new Runnable() {
            @Override
            public void run() {
                ObjectAdapter adapter = getAdapterManager().getAdapterFor(pojo);
               
                final IsisTransaction transaction = getCurrentTransaction();
                transaction.enlistDeleting(adapter);

                ensureFrameworksInAgreement(pojo);
            }
        }, calledFrom);
       
View Full Code Here

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

    public void close() {
        ensureOpened();
        ensureThatState(persistenceManager, is(notNullValue()));

        try {
            final IsisTransaction currentTransaction = getTransactionManager().getTransaction();
            if (currentTransaction != null && !currentTransaction.getState().isComplete()) {
                if(currentTransaction.getState().canCommit()) {
                    getTransactionManager().endTransaction();
                } else if(currentTransaction.getState().canAbort()) {
                    getTransactionManager().abortTransaction();
                }
            }
        } finally {
            // make sure release everything ok.
View Full Code Here

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


   
    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;
View Full Code Here

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

       
    }

    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 + "'");
View Full Code Here

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

        }
    }

    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 + "'");
View Full Code Here

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

    public void close() {
        ensureOpened();
        ensureThatState(persistenceManager, is(notNullValue()));

        try {
            final IsisTransaction currentTransaction = getTransactionManager().getTransaction();
            if (currentTransaction != null && !currentTransaction.getState().isComplete()) {
                if(currentTransaction.getState().canCommit()) {
                    getTransactionManager().endTransaction();
                } else if(currentTransaction.getState().canAbort()) {
                    getTransactionManager().abortTransaction();
                }
            }
        } finally {
            // make sure release everything ok.
View Full Code Here

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

                   
                    getPersistenceSession().remapAsPersistent(adapter, persistentOid);

                    callbackFacetClass = PersistedCallbackFacet.class;
                   
                    final IsisTransaction transaction = getCurrentTransaction();
                    transaction.enlistCreated(adapter);
                } else {
                    // updating
                    callbackFacetClass = UpdatedCallbackFacet.class;
                   
                    // no need to call transaction.enlist(..);
View Full Code Here

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

                    //
                    // however, at the same time, Isis has only queued up a CreateObjectCommand for the transient object, but it
                    // hasn't yet executed, so thinks that the adapter is still transient.
                    return;
                }
                final IsisTransaction transaction = getCurrentTransaction();
                transaction.enlistUpdating(adapter);

                ensureRootObject(pojo);
                ensureFrameworksInAgreement(pojo);
            }
        }, calledFrom);
View Full Code Here

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

        withLogging(pojo, new Runnable() {
            @Override
            public void run() {
                ObjectAdapter adapter = getAdapterManager().getAdapterFor(pojo);
               
                final IsisTransaction transaction = getCurrentTransaction();
                transaction.enlistDeleting(adapter);

                ensureFrameworksInAgreement(pojo);
            }
        }, calledFrom);
       
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.system.transaction.IsisTransaction

        }
        super.onEndRequest();
    }

    private void commitTransactionIfAny() {
        final IsisTransaction transaction = getTransactionManager().getTransaction();
        if (transaction != null) {
            if (transaction.getState() == IsisTransaction.State.MUST_ABORT) {
                getTransactionManager().abortTransaction();
            } else if (transaction.getState() == IsisTransaction.State.IN_PROGRESS) {
                getTransactionManager().endTransaction();
            }
        }
    }
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.