Package org.apache.isis.core.runtime.system.transaction

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


     * @deprecated - typically use just {@link #abortTran()}
     */
    @Deprecated
    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


        }
        fid.installFixtures();

        // ensure that tests are performed in separate xactn to any fixture setup.
        final IsisTransactionManager transactionManager = getTransactionManager();
        final IsisTransaction transaction = transactionManager.getTransaction();
        final State transactionState = transaction.getState();
        if(transactionState.canCommit()) {
            commitTran();
            try {
                bounceSystem();
            } catch (Exception e) {
View Full Code Here

        return IsisContext.getMessageBroker();
    }

    @Override
    public TransactionState getTransactionState() {
        final IsisTransaction transaction = getTransactionManager().getTransaction();
        if(transaction == null) {
            return TransactionState.NONE;
        }
        IsisTransaction.State state = transaction.getState();
        return state.getRuntimeContextState();
    }
View Full Code Here

    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

                    getPersistenceSession().remapAsPersistent(adapter, persistentOid);

                    CallbackFacet.Util.callCallback(adapter, PersistedCallbackFacet.class);

                    final IsisTransaction transaction = getCurrentTransaction();
                    transaction.enlistCreated(adapter);
                } else {
                    // updating;
                    // the callback and transaction.enlist are done in the preDirty callback
                    // (can't be done here, as the enlist requires to capture the 'before' values)
                    CallbackFacet.Util.callCallback(adapter, UpdatedCallbackFacet.class);
View Full Code Here

                    return;
                }

                CallbackFacet.Util.callCallback(adapter, UpdatingCallbackFacet.class);

                final IsisTransaction transaction = getCurrentTransaction();
                transaction.enlistUpdating(adapter);

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

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

                CallbackFacet.Util.callCallback(adapter, RemovingCallbackFacet.class);
                ensureFrameworksInAgreement(pojo);
            }
        }, calledFrom);
View Full Code Here

    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

                   
                    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

                    //
                    // 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

TOP

Related Classes of org.apache.isis.core.runtime.system.transaction.IsisTransaction

Copyright © 2018 www.massapicom. 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.