Package org.springframework.transaction.support

Examples of org.springframework.transaction.support.TransactionSynchronization


                            TransactionSynchronizationManager.setActualTransactionActive(true);
                            TransactionSynchronizationManager.setCurrentTransactionReadOnly(holder.isReadOnly());
                            TransactionSynchronizationManager.setCurrentTransactionName(holder.getName());
                            TransactionSynchronizationManager.initSynchronization();
                            for (Iterator<?> it = holder.getSuspendedSynchronizations().iterator(); it.hasNext();) {
                                TransactionSynchronization synchronization = (TransactionSynchronization) it.next();
                                synchronization.resume();
                                TransactionSynchronizationManager.registerSynchronization(synchronization);
                            }
                        }
                    }
                } catch (SystemException e) {
View Full Code Here


      tas.close();
      tac.close();

      List synchs = TransactionSynchronizationManager.getSynchronizations();
      assertEquals(1, synchs.size());
      TransactionSynchronization synch = (TransactionSynchronization) synchs.get(0);
      synch.beforeCommit(false);
      synch.beforeCompletion();
      synch.afterCommit();
      synch.afterCompletion(TransactionSynchronization.STATUS_UNKNOWN);
    }
    finally {
      TransactionSynchronizationManager.clearSynchronization();
      scf.destroy();
    }
View Full Code Here

    ut.commit();
    utControl.setVoidCallable(1);
    utControl.replay();

    MockControl synchControl = MockControl.createControl(TransactionSynchronization.class);
    final TransactionSynchronization synch = (TransactionSynchronization) synchControl.getMock();
    synch.beforeCommit(false);
    synchControl.setVoidCallable(1);
    synch.beforeCompletion();
    synchControl.setVoidCallable(1);
    synch.afterCommit();
    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_COMMITTED);
    synchControl.setVoidCallable(1);
    synchControl.replay();

    JtaTransactionManager ptm = newJtaTransactionManager(ut);
    TransactionTemplate tt = new TransactionTemplate(ptm);
View Full Code Here

    ut.commit();
    utControl.setVoidCallable(1);
    utControl.replay();

    MockControl synchControl = MockControl.createControl(TransactionSynchronization.class);
    final TransactionSynchronization synch = (TransactionSynchronization) synchControl.getMock();
    synch.beforeCommit(false);
    synchControl.setVoidCallable(1);
    synch.beforeCompletion();
    synchControl.setVoidCallable(1);
    synch.afterCommit();
    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_COMMITTED);
    synchControl.setVoidCallable(1);
    synchControl.replay();

    JtaTransactionManager ptm = newJtaTransactionManager(ut);
    TransactionTemplate tt = new TransactionTemplate(ptm);
View Full Code Here

    ut.rollback();
    utControl.setVoidCallable(1);
    utControl.replay();

    MockControl synchControl = MockControl.createControl(TransactionSynchronization.class);
    final TransactionSynchronization synch = (TransactionSynchronization) synchControl.getMock();
    synch.beforeCompletion();
    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_ROLLED_BACK);
    synchControl.setVoidCallable(1);
    synchControl.replay();

    JtaTransactionManager ptm = newJtaTransactionManager(ut);
    TransactionTemplate tt = new TransactionTemplate(ptm);
View Full Code Here

    ut.rollback();
    utControl.setVoidCallable(1);
    utControl.replay();

    MockControl synchControl = MockControl.createControl(TransactionSynchronization.class);
    final TransactionSynchronization synch = (TransactionSynchronization) synchControl.getMock();
    synch.beforeCompletion();
    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_ROLLED_BACK);
    synchControl.setVoidCallable(1);
    synchControl.replay();

    JtaTransactionManager ptm = newJtaTransactionManager(ut);
    TransactionTemplate tt = new TransactionTemplate(ptm);
View Full Code Here

    ut.setRollbackOnly();
    utControl.setVoidCallable(1);
    utControl.replay();

    MockControl synchControl = MockControl.createControl(TransactionSynchronization.class);
    final TransactionSynchronization synch = (TransactionSynchronization) synchControl.getMock();
    synch.beforeCompletion();
    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_UNKNOWN);
    synchControl.setVoidCallable(1);
    synchControl.replay();

    JtaTransactionManager ptm = newJtaTransactionManager(ut);
    TransactionTemplate tt = new TransactionTemplate(ptm);
View Full Code Here

    ut.setRollbackOnly();
    utControl.setVoidCallable(1);
    utControl.replay();

    MockControl synchControl = MockControl.createControl(TransactionSynchronization.class);
    final TransactionSynchronization synch = (TransactionSynchronization) synchControl.getMock();
    synch.beforeCompletion();
    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_UNKNOWN);
    synchControl.setVoidCallable(1);
    synchControl.replay();

    JtaTransactionManager ptm = newJtaTransactionManager(ut);
    TransactionTemplate tt = new TransactionTemplate(ptm);
View Full Code Here

    ut.setRollbackOnly();
    utControl.setVoidCallable(1);
    utControl.replay();

    MockControl synchControl = MockControl.createControl(TransactionSynchronization.class);
    final TransactionSynchronization synch = (TransactionSynchronization) synchControl.getMock();
    synch.beforeCommit(false);
    synchControl.setThrowable(new OptimisticLockingFailureException(""));
    synch.beforeCompletion();
    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_UNKNOWN);
    synchControl.setVoidCallable(1);
    synchControl.replay();

    JtaTransactionManager ptm = newJtaTransactionManager(ut);
    TransactionTemplate tt = new TransactionTemplate(ptm);
View Full Code Here

    ut.setRollbackOnly();
    utControl.setVoidCallable(1);
    utControl.replay();

    MockControl synchControl = MockControl.createControl(TransactionSynchronization.class);
    final TransactionSynchronization synch = (TransactionSynchronization) synchControl.getMock();
    synch.beforeCompletion();
    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_UNKNOWN);
    synchControl.setVoidCallable(1);
    synchControl.replay();

    JtaTransactionManager ptm = newJtaTransactionManager(ut);
    ptm.setGlobalRollbackOnParticipationFailure(false);
View Full Code Here

TOP

Related Classes of org.springframework.transaction.support.TransactionSynchronization

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.