Package org.springframework.transaction.jta

Examples of org.springframework.transaction.jta.JtaTransactionManager


    utControl.replay();
    sfControl.replay();
    sessionControl.replay();
    queryControl.replay();

    JtaTransactionManager ptm = new JtaTransactionManager(ut);
    TransactionTemplate tt = new TransactionTemplate(ptm);
    tt.setReadOnly(readOnly);
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());
    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
View Full Code Here


    utControl.replay();
    tmControl.replay();
    sfControl.replay();
    sessionControl.replay();

    JtaTransactionManager ptm = new JtaTransactionManager(ut);
    TransactionTemplate tt = new TransactionTemplate(ptm);
    final List l = new ArrayList();
    l.add("test");
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());
    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
View Full Code Here

    session.isOpen();
    sessionControl.setReturnValue(true, 1);
    sfControl.replay();
    sessionControl.replay();

    JtaTransactionManager ptm = new JtaTransactionManager(ut);
    TransactionTemplate tt = new TransactionTemplate(ptm);
    final List l = new ArrayList();
    l.add("test");
    final HibernateException flushEx = new HibernateException("flush failure");
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

    session.getSessionFactory();
    sessionControl.setReturnValue(sf, 1);
    sfControl.replay();
    sessionControl.replay();

    JtaTransactionManager ptm = new JtaTransactionManager(ut);
    TransactionTemplate tt = new TransactionTemplate(ptm);
    final List l = new ArrayList();
    l.add("test");
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

    sfControl.replay();
    sessionControl.replay();

    TransactionSynchronizationManager.bindResource(sf, new SessionHolder(session));
    try {
      JtaTransactionManager ptm = new JtaTransactionManager(ut);
      TransactionTemplate tt = new TransactionTemplate(ptm);
      tt.setReadOnly(readOnly);
      final List l = new ArrayList();
      l.add("test");
      assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());
View Full Code Here

    sfControl.replay();
    sessionControl.replay();

    TransactionSynchronizationManager.bindResource(sf, new SessionHolder(session));
    try {
      JtaTransactionManager ptm = new JtaTransactionManager(ut);
      final TransactionTemplate tt = new TransactionTemplate(ptm);
      assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());
      assertTrue("Has thread session", TransactionSynchronizationManager.hasResource(sf));

      tt.execute(new TransactionCallbackWithoutResult() {
View Full Code Here

    tmControl.replay();
    sfControl.replay();
    session1Control.replay();
    session2Control.replay();

    JtaTransactionManager ptm = new JtaTransactionManager();
    ptm.setUserTransaction(ut);
    ptm.setTransactionManager(tm);
    final TransactionTemplate tt = new TransactionTemplate(ptm);
    tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);

    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
    try {
View Full Code Here

    utControl.replay();
    tmControl.replay();
    sfControl.replay();
    session1Control.replay();

    JtaTransactionManager ptm = new JtaTransactionManager();
    ptm.setUserTransaction(ut);
    ptm.setTransactionManager(tm);
    final TransactionTemplate tt = new TransactionTemplate(ptm);
    tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);

    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
    try {
View Full Code Here

    tmControl.replay();
    sfControl.replay();
    session1Control.replay();
    session2Control.replay();

    JtaTransactionManager ptm = new JtaTransactionManager();
    ptm.setUserTransaction(ut);
    ptm.setTransactionManager(tm);
    final TransactionTemplate tt = new TransactionTemplate(ptm);
    tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);

    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
    try {
View Full Code Here

    session.close();
    sessionControl.setReturnValue(null, 1);
    sfControl.replay();
    sessionControl.replay();

    JtaTransactionManager tm = new JtaTransactionManager(ut);
    TransactionTemplate tt = new TransactionTemplate(tm);
    tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_SUPPORTS);
    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));

    tt.execute(new TransactionCallback() {
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.