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 (17.6.2.8 + 17.6.2.9). 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 ]