|
From: <jue...@we...> - 2004-03-01 07:34:37
|
Good point - just changed it. This is also consistent with how = ContextLoaderListener and FrameworkServlet behave in a web container. =20 Juergen =20 ________________________________ Von: spr...@li... im Auftrag = von Luke Taylor Gesendet: So 29.02.2004 22:01 An: spr...@li... Betreff: [Springframework-developer] AbstractStatelessSessionBean I've just been looking at this class after someone had a problem in the user list and it throws a CreateException if it fails to load the bean factory correctly. CreateException is supposed to be treated as an application exception by an EJB container so is unlikely to be logged by the container (it doesn't seem to be by JBoss at any rate). Since ejbCreate is called on bean creation, rather than when the client calls create() there's a danger the exception could be silently swallowed when the session bean pool is being populated and the client won't see it. Even if the server does log it, it might not obviously correspond to the client error. I think it might be better to just throw the BeansException directly. It will be logged by the container and the bean will be destroyed. In fact, it might be better to encourage this behaviour from onEJBCreate by removing CreateException from the throws clause altogether. From a quick look at the spec, it seems that only a runtime exception will cause the bean to be destroyed, and I can't think of a situation with an SSB where one would want to throw an exception on creation yet have the bean remain in the pool to be invoked by a client later. At the very least the BeansException should probably be logged. What does everyone think? I really wonder why I ever thought EJBs might be a good thing... probably because they seemed simpler than CORBA :). Luke. -- Luke Taylor. Monkey Machine Ltd. PGP Key ID: 0x57E9523C http://www.monkeymachine.ltd.uk ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=3D1356&alloc_id=3D3438&op=3Dclick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |