protected void checkNoTxPropagation(Invocation mi) throws Exception {
// No problem for local
if (mi.isLocal())
return;
// Do we have a foreign transaction context?
Transaction tx = mi.getTransaction();
if (tx == null || (tx instanceof ForeignTransaction) == false)
return;
byte txType = container.getBeanMetaData().getTransactionMethod(mi.getMethod(), mi.getType());
if (txType != MetaData.TX_NOT_SUPPORTED && txType != MetaData.TX_REQUIRES_NEW)
throw new RemoteException("TxPropagation is not supported: " + container.getJmxName() + " method=" + mi.getMethod());
// The propogation is not a problem
mi.setTransaction(null);
}
|