As per online ans:- Mandatory and NotSupported are dangerous, because they throw Exception.
Is NotSupported throw exception? Is this Ans is correct?
Originally posted by Valentin Crettaz:
For instance, the container will throw the java.lang.IllegalStateException if either getRollbackOnly() or setRollbackOnly() are invoked from a business method executing with the Supports, NotSupported or Never transaction attributes (220.127.116.11 + 18.104.22.168). Thus, it is possible that an exception be thrown when the NotSupported attribute is specified.
I understand that a transaction with "NotSupported" attribute can throw exception and hence can be dangerous. But I don't understand how "NotSupported" is more dangerous than "Never". In "Never" too there is possibility of having methods calls to get/setRollbackOnly() that cause an exception. Also in "Never" an Exception can be thrown if called from a transaction which is not the case in "NotSupported" as it just suspends the transaction. :roll:
[ May 17, 2005: Message edited by: ana ]