Search in sources :

Example 1 with JtaTransactionPolicy

use of org.apache.openejb.core.transaction.JtaTransactionPolicy in project tomee by apache.

the class StatefulContainer method getTransaction.

private Transaction getTransaction(final ThreadContext callContext) {
    final TransactionPolicy policy = callContext.getTransactionPolicy();
    Transaction currentTransaction = null;
    if (policy instanceof JtaTransactionPolicy) {
        final JtaTransactionPolicy jtaPolicy = (JtaTransactionPolicy) policy;
        currentTransaction = jtaPolicy.getCurrentTransaction();
    }
    return currentTransaction;
}
Also used : Transaction(javax.transaction.Transaction) SuspendedTransaction(org.apache.openejb.core.transaction.BeanTransactionPolicy.SuspendedTransaction) EjbUserTransaction(org.apache.openejb.core.transaction.EjbUserTransaction) JtaTransactionPolicy(org.apache.openejb.core.transaction.JtaTransactionPolicy) JtaTransactionPolicy(org.apache.openejb.core.transaction.JtaTransactionPolicy) TransactionPolicy(org.apache.openejb.core.transaction.TransactionPolicy) BeanTransactionPolicy(org.apache.openejb.core.transaction.BeanTransactionPolicy)

Example 2 with JtaTransactionPolicy

use of org.apache.openejb.core.transaction.JtaTransactionPolicy in project tomee by apache.

the class ManagedContainer method getTransaction.

private Transaction getTransaction(final ThreadContext callContext) {
    final TransactionPolicy policy = callContext.getTransactionPolicy();
    Transaction currentTransaction = null;
    if (policy instanceof JtaTransactionPolicy) {
        final JtaTransactionPolicy jtaPolicy = (JtaTransactionPolicy) policy;
        currentTransaction = jtaPolicy.getCurrentTransaction();
    }
    return currentTransaction;
}
Also used : Transaction(javax.transaction.Transaction) SuspendedTransaction(org.apache.openejb.core.transaction.BeanTransactionPolicy.SuspendedTransaction) EjbUserTransaction(org.apache.openejb.core.transaction.EjbUserTransaction) JtaTransactionPolicy(org.apache.openejb.core.transaction.JtaTransactionPolicy) JtaTransactionPolicy(org.apache.openejb.core.transaction.JtaTransactionPolicy) TransactionPolicy(org.apache.openejb.core.transaction.TransactionPolicy) BeanTransactionPolicy(org.apache.openejb.core.transaction.BeanTransactionPolicy)

Aggregations

Transaction (javax.transaction.Transaction)2 BeanTransactionPolicy (org.apache.openejb.core.transaction.BeanTransactionPolicy)2 SuspendedTransaction (org.apache.openejb.core.transaction.BeanTransactionPolicy.SuspendedTransaction)2 EjbUserTransaction (org.apache.openejb.core.transaction.EjbUserTransaction)2 JtaTransactionPolicy (org.apache.openejb.core.transaction.JtaTransactionPolicy)2 TransactionPolicy (org.apache.openejb.core.transaction.TransactionPolicy)2