Package org.springframework.transaction.jta

Examples of org.springframework.transaction.jta.JtaTransactionManager


    utControl.setReturnValue(Status.STATUS_ACTIVE, 1);
    ut.rollback();
    utControl.setVoidCallable(1);
    utControl.replay();

    JtaTransactionManager ptm = newJtaTransactionManager(ut);
    TransactionTemplate tt = new TransactionTemplate(ptm);
    ptm.setTransactionSynchronizationName("SYNCHRONIZATION_NEVER");
    tt.setTimeout(10);
    ptm.afterPropertiesSet();

    assertFalse(TransactionSynchronizationManager.isSynchronizationActive());
    tt.execute(new TransactionCallbackWithoutResult() {
      protected void doInTransactionWithoutResult(TransactionStatus status) {
        assertFalse(TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here


    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_UNKNOWN);
    synchControl.setVoidCallable(1);
    synchControl.replay();

    JtaTransactionManager ptm = newJtaTransactionManager(ut);
    TransactionTemplate tt = new TransactionTemplate(ptm);
    assertFalse(TransactionSynchronizationManager.isSynchronizationActive());
    tt.execute(new TransactionCallbackWithoutResult() {
      protected void doInTransactionWithoutResult(TransactionStatus status) {
        assertTrue(TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_UNKNOWN);
    synchControl.setVoidCallable(1);
    synchControl.replay();

    JtaTransactionManager ptm = newJtaTransactionManager(ut);
    TransactionTemplate tt = new TransactionTemplate(ptm);
    assertFalse(TransactionSynchronizationManager.isSynchronizationActive());
    try {
      tt.execute(new TransactionCallbackWithoutResult() {
        protected void doInTransactionWithoutResult(TransactionStatus status) {
View Full Code Here

    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_UNKNOWN);
    synchControl.setVoidCallable(1);
    synchControl.replay();

    JtaTransactionManager ptm = newJtaTransactionManager(ut);
    TransactionTemplate tt = new TransactionTemplate(ptm);
    assertFalse(TransactionSynchronizationManager.isSynchronizationActive());
    try {
      tt.execute(new TransactionCallbackWithoutResult() {
        protected void doInTransactionWithoutResult(TransactionStatus status) {
View Full Code Here

    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_UNKNOWN);
    synchControl.setVoidCallable(1);
    synchControl.replay();

    JtaTransactionManager ptm = newJtaTransactionManager(ut);
    ptm.setGlobalRollbackOnParticipationFailure(false);
    TransactionTemplate tt = new TransactionTemplate(ptm);
    assertFalse(TransactionSynchronizationManager.isSynchronizationActive());
    tt.execute(new TransactionCallbackWithoutResult() {
      protected void doInTransactionWithoutResult(TransactionStatus status) {
        assertTrue(TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_UNKNOWN);
    synchControl.setVoidCallable(1);
    synchControl.replay();

    JtaTransactionManager ptm = newJtaTransactionManager(ut);
    ptm.setGlobalRollbackOnParticipationFailure(false);
    TransactionTemplate tt = new TransactionTemplate(ptm);
    assertFalse(TransactionSynchronizationManager.isSynchronizationActive());
    try {
      tt.execute(new TransactionCallbackWithoutResult() {
        protected void doInTransactionWithoutResult(TransactionStatus status) {
View Full Code Here

    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_ROLLED_BACK);
    synchControl.setVoidCallable(1);
    synchControl.replay();

    JtaTransactionManager ptm = newJtaTransactionManager(ut, tm);
    TransactionTemplate tt = new TransactionTemplate(ptm);
    assertFalse(TransactionSynchronizationManager.isSynchronizationActive());
    tt.execute(new TransactionCallbackWithoutResult() {
      protected void doInTransactionWithoutResult(TransactionStatus status) {
        assertTrue(TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_UNKNOWN);
    synchControl.setVoidCallable(1);
    synchControl.replay();

    JtaTransactionManager ptm = newJtaTransactionManager(ut);
    TransactionTemplate tt = new TransactionTemplate(ptm);
    ptm.setTransactionSynchronization(JtaTransactionManager.SYNCHRONIZATION_ON_ACTUAL_TRANSACTION);
    assertFalse(TransactionSynchronizationManager.isSynchronizationActive());
    tt.execute(new TransactionCallbackWithoutResult() {
      protected void doInTransactionWithoutResult(TransactionStatus status) {
        assertTrue(TransactionSynchronizationManager.isSynchronizationActive());
        TransactionSynchronizationManager.registerSynchronization(synch);
View Full Code Here

    utControl.setReturnValue(Status.STATUS_ACTIVE, 2);
    ut.setRollbackOnly();
    utControl.setVoidCallable(1);
    utControl.replay();

    JtaTransactionManager ptm = newJtaTransactionManager(ut);
    TransactionTemplate tt = new TransactionTemplate(ptm);
    ptm.setTransactionSynchronization(JtaTransactionManager.SYNCHRONIZATION_NEVER);
    ptm.afterPropertiesSet();

    assertFalse(TransactionSynchronizationManager.isSynchronizationActive());
    tt.execute(new TransactionCallbackWithoutResult() {
      protected void doInTransactionWithoutResult(TransactionStatus status) {
        assertFalse(TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_UNKNOWN);
    synchControl.setVoidCallable(1);
    synchControl.replay();

    JtaTransactionManager ptm = newJtaTransactionManager(ut);
    TransactionTemplate tt = new TransactionTemplate(ptm);
    tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_SUPPORTS);
    assertFalse(TransactionSynchronizationManager.isSynchronizationActive());
    tt.execute(new TransactionCallbackWithoutResult() {
      protected void doInTransactionWithoutResult(TransactionStatus status) {
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.