Very good question Severin
Actually, if you look a little further in the spec, section 17.6.2.9 states that:
"The Container must handle the EJBContext.getRollbackOnly() method invoked from a business method executing with the Required, RequiresNew, or Mandatory transaction attribute.
The Container must throw the java.lang.IllegalStateException if the EJBContext. getRollbackOnly() method is invoked from a business method executing with the Supports, NotSupported, or Never transaction attribute."
...which corroborates what HeadFirstEJB says.
In the section you quote (17.6.2.3), there is also a very important note at the end, which is:
"
The Supports transaction attribute must be used with caution. This is because of the different transactional semantics provided by the two possible modes of execution. Only the enterprise beans that will execute correctly in both modes should use the Supports transaction attribute."
In case of a business method with a Supports transaction attribute, if the client calls without a meaningful transaction context, the container will throw an IllegalStateException. This is a system level exception, and thus, the container will apply the usual rules for taking care of this (as summarized in Table 15, p. 375, last two rows):
- Log the exception
- Discard the bean instance
- Throw RemoteException to remote clients and EJBException to local clients
Also, it is important to read section 17.6.5 to understand what happens in the case the bean runs within an unspecified transaction context.