I can't answer your question, but as a workaround you can call
getStatus on the TransactionManager - if the status is
Status.STATUS_NO_TRANSACTION then there's not currently a transaction.
Aaron
On Mon, 5 Jun 2000, Jung , Christoph wrote:
> Hi,
>
> In my JTA spec (page 35, May 12 1999), it says that
> TransactionManager.getTransaction() returns null if the current thread�s
> transaction context
> is empty. In the jBoss code, I found the following:
>
> public Transaction getTransaction()
> throws SystemException
> {
> Transaction current = (Transaction)tx.get();
>
> //DEBUG Logger.debug("Current="+current);
>
> if (current == null)
> return noTx;
> else
> return current;
> }
>
> May I ask what the advantage of a default noTx transaction is? It makes the
> task of detecting an empty context and throwing
> an exception quite hard, since noTx isn�t even a public static against which
> you could compare something ...
>
> Best,
> CGJ
>