Package org.springframework.transaction.jta

Examples of org.springframework.transaction.jta.JtaTransactionManager


    dsControl.replay();

    final DataSource dsToUse = useTransactionAwareDataSource ?
        new TransactionAwareDataSourceProxy(ds) : ds;

    JtaTransactionManager ptm = new JtaTransactionManager(ut, tm);
    final TransactionTemplate tt = new TransactionTemplate(ptm);
    tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
    assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(dsToUse));
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here


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

    final JtaTransactionManager ptm = new JtaTransactionManager(ut, tm);
    TransactionTemplate tt = new TransactionTemplate(ptm);
    tt.setPropagationBehavior(notSupported ?
        TransactionDefinition.PROPAGATION_NOT_SUPPORTED : TransactionDefinition.PROPAGATION_SUPPORTS);

    assertFalse(TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

        new TransactionAwareDataSourceProxy(ds) : ds;
    if (dsToUse instanceof TransactionAwareDataSourceProxy) {
      ((TransactionAwareDataSourceProxy) dsToUse).setReobtainTransactionalConnections(true);
    }

    JtaTransactionManager ptm = new JtaTransactionManager(ut, tm);
    final TransactionTemplate tt = new TransactionTemplate(ptm);
    tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
    assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(dsToUse));
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

    MockControl dsControl = MockControl.createControl(DataSource.class);
    final DataSource ds = (DataSource) dsControl.getMock();
    MockControl conControl = MockControl.createControl(Connection.class);
    Connection con = (Connection) conControl.getMock();

    JtaTransactionManager ptm = new JtaTransactionManager(ut) {
      protected void doRegisterAfterCompletionWithJtaTransaction(
          JtaTransactionObject txObject, final List synchronizations) {
        Thread async = new Thread() {
          public void run() {
            invokeAfterCompletion(synchronizations, TransactionSynchronization.STATUS_COMMITTED);
View Full Code Here

    final IsolationLevelDataSourceAdapter dsToUse = new IsolationLevelDataSourceAdapter();
    dsToUse.setTargetDataSource(ds1);
    dsToUse.afterPropertiesSet();

    JtaTransactionManager ptm = new JtaTransactionManager(ut);
    ptm.setAllowCustomIsolationLevels(true);

    TransactionTemplate tt = new TransactionTemplate(ptm);
    tt.execute(new TransactionCallbackWithoutResult() {
      protected void doInTransactionWithoutResult(TransactionStatus status) throws RuntimeException {
        Connection c = DataSourceUtils.getConnection(dsToUse);
View Full Code Here

      dsToUse.setDefaultTargetDataSource(ds1);
    }
    dsToUse.setTargetDataSources(targetDataSources);
    dsToUse.afterPropertiesSet();

    JtaTransactionManager ptm = new JtaTransactionManager(ut);
    ptm.setAllowCustomIsolationLevels(true);

    TransactionTemplate tt = new TransactionTemplate(ptm);
    tt.execute(new TransactionCallbackWithoutResult() {
      protected void doInTransactionWithoutResult(TransactionStatus status) throws RuntimeException {
        Connection c = DataSourceUtils.getConnection(dsToUse);
View Full Code Here

    private final PlatformTransactionManager platformTransactionManager;
    private final Map<Transaction, SuspendedResourcesHolder> suspendedResources = new ConcurrentHashMap<Transaction, SuspendedResourcesHolder>();

    public GeronimoPlatformTransactionManager() throws XAException {
        platformTransactionManager = new JtaTransactionManager(this, this);
        registerTransactionAssociationListener();
    }
View Full Code Here

        registerTransactionAssociationListener();
    }

    public GeronimoPlatformTransactionManager(int defaultTransactionTimeoutSeconds) throws XAException {
        super(defaultTransactionTimeoutSeconds);
        platformTransactionManager = new JtaTransactionManager(this, this);
        registerTransactionAssociationListener();
    }
View Full Code Here

        registerTransactionAssociationListener();
    }

    public GeronimoPlatformTransactionManager(int defaultTransactionTimeoutSeconds, TransactionLog transactionLog) throws XAException {
        super(defaultTransactionTimeoutSeconds, transactionLog);
        platformTransactionManager = new JtaTransactionManager(this, this);
        registerTransactionAssociationListener();
    }
View Full Code Here

        registerTransactionAssociationListener();
    }

    public GeronimoPlatformTransactionManager(int defaultTransactionTimeoutSeconds, XidFactory xidFactory, TransactionLog transactionLog) throws XAException {
        super(defaultTransactionTimeoutSeconds, xidFactory, transactionLog);
        platformTransactionManager = new JtaTransactionManager(this, this);
        registerTransactionAssociationListener();
    }
View Full Code Here

TOP

Related Classes of org.springframework.transaction.jta.JtaTransactionManager

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.