Examples of registerInterposedSynchronization()


Examples of javax.transaction.TransactionSynchronizationRegistry.registerInterposedSynchronization()

        // create and register transaction listener
        JtaTxnListener txnListener = createJtaTxnListener(newTrans);
       
        syncRegistry.putResource(EBEAN_TXN_RESOURCE, newTrans);
        syncRegistry.registerInterposedSynchronization(txnListener);
       
        // also put in Ebean ThreadLocal
        DefaultTransactionThreadLocal.set(serverName, newTrans);
        return newTrans;
    }
View Full Code Here

Examples of javax.transaction.TransactionSynchronizationRegistry.registerInterposedSynchronization()

                    //and if the transaction is rolled back we release the instance back into the pool

                    final TransactionSynchronizationRegistry transactionSynchronizationRegistry = entityBeanComponent.getTransactionSynchronizationRegistry();
                    if (transactionSynchronizationRegistry.getTransactionKey() != null) {
                        if(!instanceCachedBefore) {
                            transactionSynchronizationRegistry.registerInterposedSynchronization(new Synchronization() {
                                @Override
                                public void beforeCompletion() {

                                }
View Full Code Here

Examples of javax.transaction.TransactionSynchronizationRegistry.registerInterposedSynchronization()

        //and if the transaction is rolled back we release the instance back into the pool

        final TransactionSynchronizationRegistry transactionSynchronizationRegistry = entityBeanComponent.getTransactionSynchronizationRegistry();

        if (transactionSynchronizationRegistry.getTransactionKey() != null) {
            transactionSynchronizationRegistry.registerInterposedSynchronization(new Synchronization() {
                @Override
                public void beforeCompletion() {

                }
View Full Code Here

Examples of javax.transaction.TransactionSynchronizationRegistry.registerInterposedSynchronization()

                        // if the thread is currently associated with a tx, then register a tx synchronization
                        if (currentTransactionKey != null) {
                            // register a tx synchronization for this entity instance
                            final Synchronization entitySynchronization = new EntityBeanSynchronization(instance, lockOwner);
                            transactionSynchronizationRegistry.registerInterposedSynchronization(entitySynchronization);
                            syncRegistered = true;
                            if (ROOT_LOGGER.isTraceEnabled()) {
                                ROOT_LOGGER.trace("Registered tx synchronization: " + entitySynchronization + " for tx: " + currentTransactionKey +
                                        " associated with stateful component instance: " + instance);
                            }
View Full Code Here

Examples of javax.transaction.TransactionSynchronizationRegistry.registerInterposedSynchronization()

import org.drools.persistence.jta.JtaTransactionSynchronizationAdapter;

public class TransactionSynchronizationRegistryHelper {
    public static void registerTransactionSynchronization(final Object tsro, final TransactionSynchronization ts) {
        TransactionSynchronizationRegistry tsr = ( TransactionSynchronizationRegistry ) tsro;
        tsr.registerInterposedSynchronization( new JtaTransactionSynchronizationAdapter( ts ) );
    }
}
View Full Code Here

Examples of javax.transaction.TransactionSynchronizationRegistry.registerInterposedSynchronization()

                        // if this SFSB instance is already associated with a different transaction, then it's an error
                        // if the thread is currently associated with a tx, then register a tx synchronization
                        if (currentTransactionKey != null && status != Status.STATUS_COMMITTED) {
                            // register a tx synchronization for this SFSB instance
                            final Synchronization statefulSessionSync = new StatefulSessionSynchronization(instance, lockOwner);
                            transactionSynchronizationRegistry.registerInterposedSynchronization(statefulSessionSync);
                            wasTxSyncRegistered = true;
                            if (ROOT_LOGGER.isTraceEnabled()) {
                                ROOT_LOGGER.trace("Registered tx synchronization: " + statefulSessionSync + " for tx: " + currentTransactionKey +
                                        " associated with stateful component instance: " + instance);
                            }
View Full Code Here

Examples of javax.transaction.TransactionSynchronizationRegistry.registerInterposedSynchronization()

                //if a transaction is active we register a sync
                //and if the transaction is rolled back we release the instance back into the pool

                final TransactionSynchronizationRegistry transactionSynchronizationRegistry = entityBeanComponent.getTransactionSynchronizationRegistry();
                if (transactionSynchronizationRegistry.getTransactionKey() != null) {
                    transactionSynchronizationRegistry.registerInterposedSynchronization(new Synchronization() {
                        @Override
                        public void beforeCompletion() {

                        }
View Full Code Here

Examples of javax.transaction.TransactionSynchronizationRegistry.registerInterposedSynchronization()

                        // if the thread is currently associated with a tx, then register a tx synchronization
                        if (currentTransactionKey != null) {
                            // register a tx synchronization for this entity instance
                            final Synchronization entitySynchronization = new EntityBeanSynchronization(instance, lockOwner);
                            transactionSynchronizationRegistry.registerInterposedSynchronization(entitySynchronization);
                            if (ROOT_LOGGER.isTraceEnabled()) {
                                ROOT_LOGGER.trace("Registered tx synchronization: " + entitySynchronization + " for tx: " + currentTransactionKey +
                                    " associated with stateful component instance: " + instance);
                            }
                        }
View Full Code Here

Examples of javax.transaction.TransactionSynchronizationRegistry.registerInterposedSynchronization()

        //if a transaction is active we register a sync
        //and if the transaction is rolled back we release the instance back into the pool

        final TransactionSynchronizationRegistry transactionSynchronizationRegistry = entityBeanComponent.getTransactionSynchronizationRegistry();
        if (transactionSynchronizationRegistry.getTransactionKey() != null) {
            transactionSynchronizationRegistry.registerInterposedSynchronization(new Synchronization() {
                @Override
                public void beforeCompletion() {

                }
View Full Code Here

Examples of javax.transaction.TransactionSynchronizationRegistry.registerInterposedSynchronization()

        this.relatedBeans = relatedBeans;

        relatedLocal = relatedInfo.getLocalInterface();
        TransactionSynchronizationRegistry transactionRegistry = SystemInstance.get().getComponent(TransactionSynchronizationRegistry.class);
        try {
            transactionRegistry.registerInterposedSynchronization(new Synchronization() {
                public void beforeCompletion() {
                }

                public void afterCompletion(int i) {
                    mutable = false;
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.