Search in sources :

Example 1 with TransactionImpl

use of org.jboss.narayana.blacktie.jatmibroker.core.tx.TransactionImpl in project narayana by jbosstm.

the class JtsTransactionImple method resume.

/**
 * Associated a transaction with the callers thread
 *
 * @param ior IOR for the corresponding OTS transaction, must not be null
 * @param control
 *
 * @throws SystemException
 * @throws IllegalStateException
 * @throws InvalidTransactionException
 * @throws ConfigurationException
 * @throws TransactionException
 */
public static void resume(String ior) throws InvalidTransactionException, IllegalStateException, SystemException, ConfigurationException, TransactionException {
    log.debug("resume control");
    if (hasTransactionManager()) {
        Transaction tx = controlToTx(ior);
        tm.resume(tx);
    } else {
        TransactionImpl transaction = new TransactionImpl(ior);
        TransactionImpl.resume(transaction);
    }
}
Also used : Transaction(javax.transaction.Transaction) AtomicTransaction(com.arjuna.ats.internal.jta.transaction.jts.AtomicTransaction) TransactionImpl(org.jboss.narayana.blacktie.jatmibroker.core.tx.TransactionImpl)

Example 2 with TransactionImpl

use of org.jboss.narayana.blacktie.jatmibroker.core.tx.TransactionImpl in project narayana by jbosstm.

the class JtsTransactionImple method getTransactionIOR.

/**
 * If the current transaction represents an OTS transaction then return it IOR
 *
 * @return the IOR or null if the current transaction is not an OTS transaction
 * @throws NamingException
 * @throws org.omg.CORBA.SystemException
 * @throws SystemException
 * @throws Unavailable
 */
public static String getTransactionIOR() throws org.omg.CORBA.SystemException, SystemException, Unavailable {
    log.debug("getTransactionIOR");
    TransactionImpl curr = TransactionImpl.current();
    if (curr != null) {
        log.debug("have JtsTransactionImple");
        return curr.getControlIOR();
    } else if (hasTransaction()) {
        log.debug("have tx mgr");
        Transaction tx = tm.getTransaction();
        log.debug("have arjuna tx");
        TransactionImple atx = (TransactionImple) tx;
        ControlWrapper cw = atx.getControlWrapper();
        log.debug("lookup control");
        Control c = cw.get_control();
        String ior = ORBManager.getORB().orb().object_to_string(c);
        log.debug("getTransactionIOR: ior: " + ior);
        return ior;
    } else {
        return null;
    }
}
Also used : Control(org.omg.CosTransactions.Control) Transaction(javax.transaction.Transaction) AtomicTransaction(com.arjuna.ats.internal.jta.transaction.jts.AtomicTransaction) TransactionImple(com.arjuna.ats.internal.jta.transaction.jts.TransactionImple) ControlWrapper(com.arjuna.ats.internal.jts.ControlWrapper) TransactionImpl(org.jboss.narayana.blacktie.jatmibroker.core.tx.TransactionImpl)

Aggregations

AtomicTransaction (com.arjuna.ats.internal.jta.transaction.jts.AtomicTransaction)2 Transaction (javax.transaction.Transaction)2 TransactionImpl (org.jboss.narayana.blacktie.jatmibroker.core.tx.TransactionImpl)2 TransactionImple (com.arjuna.ats.internal.jta.transaction.jts.TransactionImple)1 ControlWrapper (com.arjuna.ats.internal.jts.ControlWrapper)1 Control (org.omg.CosTransactions.Control)1