Package org.springframework.transaction

Examples of org.springframework.transaction.PlatformTransactionManager.commit()


            // (We could inspect the transaction data stack for the thread, but this isn't guaranteed
            // if the user has created transactions for themselves)
            try {
                PlatformTransactionManager qq_txn1 = pDataSource.getTransactionManager();
                TransactionStatus aTxnStatus = qq_txn1.getTransaction(new DefaultTransactionDefinition(TransactionDefinition.PROPAGATION_MANDATORY));
                qq_txn1.commit(aTxnStatus);
                return true;
            }
            catch (Exception e) {
                return false;
            }
View Full Code Here


                }
                else {
                  if (_log.isDebugEnabled()) {
                    _log.debug("Commit Transaction: " + transactionData);
                  }
                    aTxn.commit(currentStatus);
                    statistics.incrementCommitCount();
                }
            }
            else {
                statistics.incrementCommitCount();
View Full Code Here

    MockControl ptmControl = MockControl.createControl(PlatformTransactionManager.class);
    PlatformTransactionManager ptm = (PlatformTransactionManager) ptmControl.getMock();
    // expect a transaction
    ptm.getTransaction(txatt);
    ptmControl.setReturnValue(status, 1);
    ptm.commit(status);
    ptmControl.setVoidCallable(1);
    ptmControl.replay();

    TestBean tb = new TestBean();
    ITestBean itb = (ITestBean) advised(tb, ptm, tas);
View Full Code Here

    MockControl ptmControl = MockControl.createControl(PlatformTransactionManager.class);
    PlatformTransactionManager ptm = (PlatformTransactionManager) ptmControl.getMock();
    // expect a transaction
    ptm.getTransaction(txatt);
    ptmControl.setReturnValue(status, 2);
    ptm.commit(status);
    ptmControl.setVoidCallable(2);
    ptmControl.replay();

    TestBean tb = new TestBean();
    ITestBean itb = (ITestBean) advised(tb, ptm, new TransactionAttributeSource[] {tas1, tas2});
View Full Code Here

    MockControl ptmControl = MockControl.createControl(PlatformTransactionManager.class);
    PlatformTransactionManager ptm = (PlatformTransactionManager) ptmControl.getMock();
    // expect a transaction
    ptm.getTransaction(txatt);
    ptmControl.setReturnValue(status, 1);
    ptm.commit(status);
    ptmControl.setVoidCallable(1);
    ptmControl.replay();

    TestBean tb = new TestBean();
    ITestBean itb = (ITestBean) advised(tb, ptm, tas);
View Full Code Here

    MockControl ptmControl = MockControl.createControl(PlatformTransactionManager.class);
    PlatformTransactionManager ptm = (PlatformTransactionManager) ptmControl.getMock();
    // Expect a transaction
    ptm.getTransaction(txatt);
    ptmControl.setReturnValue(status, 1);
    ptm.commit(status);
    ptmControl.setVoidCallable(1);
    ptmControl.replay();
   
    final String spouseName = "innerName";
View Full Code Here

    ptmControl.setReturnValue(outerStatus, 1);
   
    ptm.getTransaction(innerTxatt);
    ptmControl.setReturnValue(innerStatus, 1);
   
    ptm.commit(innerStatus);
    ptmControl.setVoidCallable(1);
   
    ptm.commit(outerStatus);
    ptmControl.setVoidCallable(1);
    ptmControl.replay();
View Full Code Here

    ptmControl.setReturnValue(innerStatus, 1);
   
    ptm.commit(innerStatus);
    ptmControl.setVoidCallable(1);
   
    ptm.commit(outerStatus);
    ptmControl.setVoidCallable(1);
    ptmControl.replay();
   
    final String spouseName = "innerName";
View Full Code Here

    if (shouldRollback) {
      ptm.rollback(status);
    }
    else {
      ptm.commit(status);
    }
    TransactionSystemException tex = new TransactionSystemException("system exception");
    if (rollbackException) {
      ptmControl.setThrowable(tex, 1);
    }
View Full Code Here

    MockControl ptmControl = MockControl.createControl(PlatformTransactionManager.class);
    PlatformTransactionManager ptm = (PlatformTransactionManager) ptmControl.getMock();

    ptm.getTransaction(txatt);
    ptmControl.setReturnValue(status, 1);
    ptm.commit(status);
    ptmControl.setVoidCallable(1);
    ptmControl.replay();

    final String name = "jenny";
    TestBean tb = new TestBean() {
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.