From: Adrian B. <adr...@jb...> - 2005-05-26 00:21:57
|
Yes, but as I said the exceptions are specializations (subclasses) of the required types, and more informative. I would never recommend coding an EJB that assumes its own transaction demarcation or that of its callees. This is a deployment time decision, not a development time decision, see Table 15 "Handling of Exceptions Thrown by a Business Method of a Bean with Container-Managed Transaction Demarcation" On Wed, 2005-05-25 at 19:01, Bill Burke wrote: > Adrian Brock wrote: > > Why are you reading the draft? 18.2.2 in ejb-2.1-fr-spec.pdf > > refers to bean providers responsiblities. > > > > I meant ejb-2.1-fr-spec.pdf. This is I was reading. > > > TransactionRolledBack IS a RemoteException and > > TransactionRolledBackLocal IS an EJBException (RuntimeException) > > > > Again, these exceptions are only mentioned in section 18.3.6 which > states the rules for exceptions thrown in callback methods, NOT EJB METHODS! > > > In no circusmtance should an EJB throw a RuntimeException to the client, > > it *should* be wrapped in either a RemoteException or EJBException. > > Although this is more a philosophy thing in the EJB spec than having > > any real reason. > > > > It SHOULD, but what we do is wrap ANY System exception thrown anywhere > in TransactionRolledbackException if the tx was initiated by the caller. > It seems what we should be doing is propagating the REmoteException > thrown, or stuffing the RuntimeException into an EJBException. > > > Show me the TCK test that causes our implementation (which is more > > informative) to fail? And explain the problem it causes since both > > exceptions have a mechanism to reach the wrapped exception > > (something that was standardize in j2se1.4). > > > > The problem is that users have to dive into the cause/exception detail > when they should just be able to catch the RemoteException or extension > of EJBException. To avoid try/catch/setRollbackOnly blocks, but still > be able to catch the exception and do something about it after TX rollsback. > > Bill > > > ------------------------------------------------------- > SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate > online with coworkers and clients while avoiding the high cost of travel and > communications. There is no equipment to buy and you can meet as often as > you want. Try it free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click > _______________________________________________ > JBoss-Development mailing list > JBo...@li... > https://lists.sourceforge.net/lists/listinfo/jboss-development -- xxxxxxxxxxxxxxxxxxxxxxxx Adrian Brock Chief Scientist JBoss Inc. xxxxxxxxxxxxxxxxxxxxxxxx |