-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contradiction in the javadoc of UserTransaction and @Transactional #68
Comments
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented
In that case it might be good idea to enhance the javadoc of UserTransaction, in order to make its contract unambiguous that its methods may throw IllegalStateException. |
@glassfishrobot Commented |
|
There is a contradiction in the JTA spec:
1. On one hand, 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 a method annotated with @transactional(TxType.REQUIRED) and within it I call userTransaction.begin(), then what should be the expected exception - IllegalStateException or NotSupportedException ?
[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
The text was updated successfully, but these errors were encountered: