Examples of beforeCompletion()


Examples of javax.transaction.Synchronization.beforeCompletion()

    }

    Synchronization synchronization = transaction.getSynchronization();
    assertTrue("JTA synchronization registered", synchronization != null);
    try {
      synchronization.beforeCompletion();
      fail("Should have thrown HibernateSystemException");
    }
    catch (HibernateSystemException ex) {
      assertSame(flushEx, ex.getCause());
    }
View Full Code Here

Examples of javax.transaction.Synchronization.beforeCompletion()

      }
    });

    Synchronization synchronization2 = transaction2.getSynchronization();
    assertTrue("JTA synchronization registered", synchronization2 != null);
    synchronization2.beforeCompletion();
    synchronization2.afterCompletion(Status.STATUS_COMMITTED);

    Synchronization synchronization1 = transaction1.getSynchronization();
    assertTrue("JTA synchronization registered", synchronization1 != null);
    synchronization1.beforeCompletion();
View Full Code Here

Examples of javax.transaction.Synchronization.beforeCompletion()

    synchronization2.beforeCompletion();
    synchronization2.afterCompletion(Status.STATUS_COMMITTED);

    Synchronization synchronization1 = transaction1.getSynchronization();
    assertTrue("JTA synchronization registered", synchronization1 != null);
    synchronization1.beforeCompletion();
    synchronization1.afterCompletion(Status.STATUS_COMMITTED);

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

Examples of javax.transaction.Synchronization.beforeCompletion()

      });
    }

    Synchronization synchronization = transaction.getSynchronization();
    assertTrue("JTA Synchronization registered", synchronization != null);
    synchronization.beforeCompletion();
    synchronization.afterCompletion(Status.STATUS_COMMITTED);

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

Examples of javax.transaction.Synchronization.beforeCompletion()

      }
    });

    Synchronization synchronization = transaction.getSynchronization();
    assertTrue("JTA synchronization registered", synchronization != null);
    synchronization.beforeCompletion();
    synchronization.afterCompletion(Status.STATUS_COMMITTED);

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

Examples of javax.transaction.Synchronization.beforeCompletion()

      sessionControl.setReturnValue(null, 1);
      sessionControl.replay();

      Synchronization synchronization = transaction.getSynchronization();
      assertTrue("JTA synchronization registered", synchronization != null);
      synchronization.beforeCompletion();
      synchronization.afterCompletion(Status.STATUS_COMMITTED);
      assertTrue("Has thread session", TransactionSynchronizationManager.hasResource(sf));
    }
    finally {
      TransactionSynchronizationManager.unbindResource(sf);
View Full Code Here

Examples of javax.transaction.Synchronization.beforeCompletion()

      // Call synchronization in a new thread, to simulate a synchronization
      // triggered by a new remote call from a remote transaction coordinator.
      Thread synch = new Thread() {
        public void run() {
          synchronization.beforeCompletion();
          synchronization.afterCompletion(Status.STATUS_COMMITTED);
        }
      };
      synch.start();
      synch.join();
View Full Code Here

Examples of javax.transaction.Synchronization.beforeCompletion()

    assertEquals("content", type.nullSafeGet(rs, new String[] {"column"}, null));
    tmControl.replay();
    type.nullSafeSet(ps, "content", 1);
    Synchronization synch = transaction.getSynchronization();
    assertNotNull(synch);
    synch.beforeCompletion();
    synch.afterCompletion(Status.STATUS_COMMITTED);
    tmControl.verify();
  }

  public void testClobStringTypeWithJtaSynchronizationAndRollback() throws Exception {
View Full Code Here

Examples of org.qi4j.api.unitofwork.UnitOfWorkCallback.beforeCompletion()

                boolean isCallback = instance.proxy() instanceof UnitOfWorkCallback;
                boolean isNotRemoved = !instance.status().equals( EntityStatus.REMOVED );
                if( isCallback && isNotRemoved )
                {
                    UnitOfWorkCallback callback = UnitOfWorkCallback.class.cast( instance.proxy() );
                    callback.beforeCompletion();
                }
            }
        }
        catch( UnitOfWorkCompletionException e )
        {
View Full Code Here

Examples of org.springframework.transaction.support.TransactionSynchronization.beforeCompletion()

      List synchs = TransactionSynchronizationManager.getSynchronizations();
      assertEquals(1, synchs.size());
      TransactionSynchronization synch = (TransactionSynchronization) synchs.get(0);
      synch.beforeCommit(false);
      synch.beforeCompletion();
      synch.afterCommit();
      synch.afterCompletion(TransactionSynchronization.STATUS_UNKNOWN);
    }
    finally {
      TransactionSynchronizationManager.clearSynchronization();
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.