You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Svetlin Zarev <sv...@gmail.com> on 2017/01/25 09:58:11 UTC
JavaEE Spec confusion
Hello,
I've stumbled upon a contradiction in the JEE spec:
1. The UserTransaction javadoc [1] states that if the thread is already
associated with a transaction and the Transaction Manager implementation
does not support nested transactions, a NotSupportedException will be
thrown.
2. On the other hand, the javadoc of the Transactional annotation [2]
states that if an attempt is made to call any method of the UserTransaction
interface from within the scope of a bean or method annotated with
@Transactional and a Transactional.TxType other than NOT_SUPPORTED or
NEVER, an IllegalStateException must be thrown
So if I have @Transactional(TxType.REQUIRED) then what
userTransaction.begin() should throw - IllegalStateException or
NotSupportedException ?
Where is the proper place to ask for clarification ? Is the jira @ java.net
the proper place for such question ?
[1]
http://docs.oracle.com/javaee/7/api/javax/transaction/UserTransaction.html#begin--
[2] http://docs.oracle.com/javaee/7/api/javax/transaction/Transactional.html
Best regards,
Svetlin
Re: JavaEE Spec confusion
Posted by Jean-Louis Monteiro <jl...@tomitribe.com>.
The JIRA @java.net is definitely a good way to ask and track the comments.
And possibly fix the javadoc if it's not clear or wrong.
--
Jean-Louis Monteiro
http://twitter.com/jlouismonteiro
http://www.tomitribe.com
On Wed, Jan 25, 2017 at 10:58 AM, Svetlin Zarev <
svetlin.angelov.zarev@gmail.com> wrote:
> Hello,
>
> I've stumbled upon a contradiction in the JEE spec:
>
> 1. The UserTransaction javadoc [1] states that if the thread is already
> associated with a transaction and the Transaction Manager implementation
> does not support nested transactions, a NotSupportedException will be
> thrown.
>
> 2. On the other hand, the javadoc of the Transactional annotation [2]
> states that if an attempt is made to call any method of the UserTransaction
> interface from within the scope of a bean or method annotated with
> @Transactional and a Transactional.TxType other than NOT_SUPPORTED or
> NEVER, an IllegalStateException must be thrown
>
> So if I have @Transactional(TxType.REQUIRED) then what
> userTransaction.begin() should throw - IllegalStateException or
> NotSupportedException ?
>
> Where is the proper place to ask for clarification ? Is the jira @
> java.net
> the proper place for such question ?
>
>
> [1]
> http://docs.oracle.com/javaee/7/api/javax/transaction/
> UserTransaction.html#begin--
> [2] http://docs.oracle.com/javaee/7/api/javax/transaction/
> Transactional.html
>
> Best regards,
> Svetlin
>