Package org.springframework.transaction

Examples of org.springframework.transaction.PlatformTransactionManager


  }

  @Test(expected = UnexpectedRollbackException.class)
  public void shouldThrowExceptionOnFailingRollback() throws Exception {
    PlatformTransactionManager first = createFailingTransactionManager("first");
    setupTransactionManagers(first);
    createAndRollbackTransaction();
  }
View Full Code Here


            container.setRecoveryInterval(recoveryInterval);
        }
        if (taskExecutor != null) {
            container.setTaskExecutor(taskExecutor);
        }
        PlatformTransactionManager tm = getTransactionManager();
        if (tm != null) {
            container.setTransactionManager(tm);
        } else if (transactionManager == null && transacted && !lazyCreateTransactionManager) {
            container.setSessionTransacted(true);
        }
View Full Code Here

    sfControl.replay();
    sessionControl.replay();
    xaResControl.replay();

    PlatformTransactionManager tm = new LocalTransactionManager(sf);
    TransactionTemplate tt = new TransactionTemplate(tm);
    final List l = new ArrayList();
    l.add("test");
    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

    sfControl.replay();
    sessionControl.replay();
    xaResControl.replay();
    final SessionHolderProviderManager providerManager = new ListSessionHolderProviderManager();

    PlatformTransactionManager tm = new LocalTransactionManager(sf);
    TransactionTemplate tt = new TransactionTemplate(tm);
    final List l = new ArrayList();
    l.add("test");
    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

    sfControl.replay();
    sessionControl.replay();
    xaResControl.replay();
    final SessionHolderProviderManager providerManager = new ListSessionHolderProviderManager();

    PlatformTransactionManager tm = new LocalTransactionManager(sf);
    TransactionTemplate tt = new TransactionTemplate(tm);
    final List l = new ArrayList();
    l.add("test");
    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

    MockControl sfControl = MockControl.createControl(SessionFactory.class);
    final SessionFactory sf = (SessionFactory) sfControl.getMock();

    sfControl.replay();

    PlatformTransactionManager tm = new LocalTransactionManager(sf);
    TransactionTemplate tt = new TransactionTemplate(tm);

    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

    sfControl.replay();
    sessionControl.replay();
    xaResControl.replay();
    final SessionHolderProviderManager providerManager = new ListSessionHolderProviderManager();

    PlatformTransactionManager tm = new LocalTransactionManager(sf);
    TransactionTemplate tt = new TransactionTemplate(tm);
    UserTxSessionHolder uTx = new UserTxSessionHolder(session);
    TransactionSynchronizationManager.bindResource(sf, uTx);

    assertTrue("Has thread session", TransactionSynchronizationManager.hasResource(sf));
View Full Code Here

    sfControl.replay();
    sessionControl.replay();
    xaResControl.replay();

    PlatformTransactionManager tm = new LocalTransactionManager(sf);
    TransactionTemplate tt = new TransactionTemplate(tm);
    UserTxSessionHolder uTx = new UserTxSessionHolder(session);
    TransactionSynchronizationManager.bindResource(sf, uTx);

    assertTrue("Has thread session", TransactionSynchronizationManager.hasResource(sf));
View Full Code Here

            container.setRecoveryInterval(recoveryInterval);
        }
        if (taskExecutor != null) {
            container.setTaskExecutor(taskExecutor);
        }
        PlatformTransactionManager tm = getTransactionManager();
        if (tm != null) {
            container.setTransactionManager(tm);
        } else if (transactionManager == null && transacted && !lazyCreateTransactionManager) {
            container.setSessionTransacted(true);
        }
View Full Code Here

            }

            //need to propagate any exceptions back to Spring container
            //so transactions can occur
            if (inMessage.getContent(Exception.class) != null && session != null) {
                PlatformTransactionManager m = jmsConfig.getTransactionManager();
                if (m != null) {
                    TransactionStatus status = m.getTransaction(null);
                    JmsResourceHolder resourceHolder =
                        (JmsResourceHolder) TransactionSynchronizationManager
                            .getResource(jmsConfig.getConnectionFactory());
                    boolean trans = resourceHolder == null
                        || !resourceHolder.containsSession(session);
View Full Code Here

TOP

Related Classes of org.springframework.transaction.PlatformTransactionManager

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.