Package org.springframework.transaction

Examples of org.springframework.transaction.PlatformTransactionManager


    txControl.setVoidCallable(1);
    pmfControl.replay();
    pmControl.replay();
    txControl.replay();

    PlatformTransactionManager tm = new JdoTransactionManager(pmf);
    TransactionTemplate tt = new TransactionTemplate(tm);
    final List l = new ArrayList();
    l.add("test");
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());
    TransactionSynchronizationManager.bindResource(pmf, new PersistenceManagerHolder(pm));
View Full Code Here


    conControl.replay();
    dsControl.replay();

    final DataSource dsToUse = (lazyConnection ? new LazyConnectionDataSourceProxy(ds) : ds);
    PlatformTransactionManager tm = new DataSourceTransactionManager(dsToUse);
    TransactionTemplate tt = new TransactionTemplate(tm);
    assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(dsToUse));
    assertTrue("Synchronization not active", !TransactionSynchronizationManager.isSynchronizationActive());

    tt.execute(new TransactionCallbackWithoutResult() {
View Full Code Here

    conControl.replay();
    dsControl.replay();

    final DataSource dsToUse = (lazyConnection ? new LazyConnectionDataSourceProxy(ds) : ds);
    PlatformTransactionManager tm = new DataSourceTransactionManager(dsToUse);
    TransactionTemplate tt = new TransactionTemplate(tm);
    assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(dsToUse));
    assertTrue("Synchronization not active", !TransactionSynchronizationManager.isSynchronizationActive());

    final RuntimeException ex = new RuntimeException("Application exception");
View Full Code Here

    ds.getConnection();
    dsControl.setReturnValue(con, 2);
    conControl.replay();
    dsControl.replay();

    PlatformTransactionManager tm = new DataSourceTransactionManager(ds);
    final TransactionTemplate tt = new TransactionTemplate(tm);
    tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
    assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(ds));
    assertTrue("Synchronization not active", !TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

    ds2.getConnection();
    ds2Control.setReturnValue(con2, 1);
    con2Control.replay();
    ds2Control.replay();

    PlatformTransactionManager tm = new DataSourceTransactionManager(ds);
    final TransactionTemplate tt = new TransactionTemplate(tm);
    tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);

    PlatformTransactionManager tm2 = new DataSourceTransactionManager(ds2);
    final TransactionTemplate tt2 = new TransactionTemplate(tm2);
    tt2.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);

    assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(ds));
    assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(ds2));
View Full Code Here

    ds.getConnection();
    dsControl.setReturnValue(con, 1);
    conControl.replay();
    dsControl.replay();

    PlatformTransactionManager tm = new DataSourceTransactionManager(ds);
    final TransactionTemplate tt = new TransactionTemplate(tm);
    tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
    assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(ds));
    assertTrue("Synchronization not active", !TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

    ds.getConnection();
    dsControl.setReturnValue(con, 1);
    conControl.replay();
    dsControl.replay();

    PlatformTransactionManager tm = new DataSourceTransactionManager(ds);
    final TransactionTemplate tt = new TransactionTemplate(tm);
    tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
    assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(ds));
    assertTrue("Synchronization not active", !TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

    dsControl.setReturnValue(con, 1);

    dsControl.replay();
    conControl.replay();

    final PlatformTransactionManager tm = new DataSourceTransactionManager(ds);
    TransactionTemplate tt = new TransactionTemplate(tm);
    tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_SUPPORTS);
    assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(ds));
    assertTrue("Synchronization not active", !TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

    dsControl.replay();
    con1Control.replay();
    con2Control.replay();

    final PlatformTransactionManager tm = new DataSourceTransactionManager(ds);
    TransactionTemplate tt = new TransactionTemplate(tm);
    tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_SUPPORTS);
    assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(ds));
    assertTrue("Synchronization not active", !TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

    conControl.setVoidCallable(1);

    conControl.replay();
    dsControl.replay();

    PlatformTransactionManager tm = new DataSourceTransactionManager(ds);
    TransactionTemplate tt = new TransactionTemplate(tm);
    tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
    tt.setIsolationLevel(TransactionDefinition.ISOLATION_SERIALIZABLE);
    tt.setReadOnly(true);
    assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(ds));
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.