Package javax.transaction

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


    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

      });
    }

    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

      }
    });

    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

        });
      }

      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

      // coordinator.
      Thread synch = new Thread() {

        @Override
        public void run() {
          synchronization.beforeCompletion();
          synchronization.afterCompletion(Status.STATUS_COMMITTED);
        }
      };
      synch.start();
      synch.join();
View Full Code Here

      });
    }

    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

    }

    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

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

  @Test
View Full Code Here

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

    verify(lobCreator).setBlobAsBytes(ps, 1, contentBytes);
  }
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.