In HeadFirstEJB p.508 : "Stateless session beans must complete a transaction by the end of the business method in which the transaction was started". Will the following be legal for a stateless session BMT bean :
What you have written is illegal for a SLSB. The container will detect this and do the following: Log this as an application error to alert the system administrator. Roll back the started transaction. Discard the instance of the session bean. Throw the java.rmi.RemoteException to the client if the client is a remote client, or throw the javax.ejb.EJBException if the client is a local client.
I would say that javax.transaction.NotSupportedException is an unexpected exception in the client point of view, as the client need not know what type of transaction is used in the bean (Flat Transaction or Nested Transaction). (In reference to Page 543 of HFEJB)