/** * Remove the resource from book-keeping * * @param h ResourceHandle to be delisted * @throws javax.transaction.SystemException when not able to delist the resource */ private void enforceDelistment(ResourceHandle h) throws SystemException { JavaEETransaction txn = (JavaEETransaction) ConnectorRuntime.getRuntime().getTransaction(); if (txn != null) { Set set = txn.getResources(poolInfo); if (set != null) set.remove(h); } }
/** * Returns the transaction component is participating. * * @return Handle to the <code>Transaction</code> object. * @exception <code>PoolingException<code> If exception is thrown * while getting the transaction. */ public Transaction getTransaction() throws PoolingException { try { return ConnectorRuntime.getRuntime().getTransaction(); } catch (Exception ex) { _logger.log(Level.SEVERE,"poolmgr.unexpected_exception",ex); throw new PoolingException(ex.toString(), ex); } }
/** * Check whether the local resource in question is the one participating in transaction. * * @param h ResourceHandle * @return true if the resource is participating in the transaction */ public boolean isLocalResourceInTransaction(ResourceHandle h) { boolean result = true; try { JavaEETransaction txn = (JavaEETransaction) ConnectorRuntime.getRuntime().getTransaction(); if (txn != null) result = isNonXAResourceInTransaction(txn, h); } catch (SystemException e) { if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Exception while checking whether the resource [ of pool : " + poolInfo + " ] " + "is nonxa and is enlisted in transaction : ", e); } } return result; }
/** * Check whether a local transaction is in progress. * * @return true if a local transaction is in progress. */ public boolean isLocalTransactionInProgress() { boolean result = false; try { JavaEETransaction txn = (JavaEETransaction) ConnectorRuntime.getRuntime().getTransaction(); if(txn != null) { result = txn.isLocalTx(); } } catch (SystemException e) { if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Exception while checking whether a local " + "transaction is in progress while using pool : " + poolInfo, e); } } return result; } /**
/** * Returns the transaction component is participating. * * @return Handle to the <code>Transaction</code> object. * @exception <code>PoolingException<code> */ public Transaction getTransaction() throws PoolingException { InvocationManager invmgr = ConnectorRuntime.getRuntime().getInvocationManager(); ComponentInvocation inv = invmgr.getCurrentInvocation(); if (inv == null) { try { return ConnectorRuntime.getRuntime().getTransaction(); } catch (Exception ex) { return null; } } return (Transaction) inv.getTransaction(); }