Nov 11th, 2005, 10:04 AM
thread created when loading application context in AbstractJmsMessageDrivenBean
I'm pitching Spring to my current project leads. A first step was creating an MDB using AbstractJmsMessageDrivenBean and helper POJOs. It was pointed out, though, that an extra thread was created in the EJB container and that's seen as an issue. It's not just related to the EJB specification regarding thread management, someone much higher up than I has declared that no threads can be created in an EJB context. No doubt they're trying to be sure the EJB spec. is followed, but it means I need to have a VERY VERY good, clear and concise explanation of why that extra thread is not a problem.
I've read http://opensource2.atlassian.com/pro...rowse/SPR-1364 "Bug in AbstractStatelessSessionBean/WeakReferenceMonitor" and http://forum.springframework.org/showthread.php?t=18802 "IllegalThreadState thrown from WeakReferenceMonitor". Andreas and Juergen make the point that the spec does not specifically preclude Spring's thread management in EJBs and the need to be pragmatic. It's also pointed out that if EJBs had something like ServletContext, life would be better. These are great points but I need to be careful not to sound like I'm lamenting the spec., aka "the standard". I need to make the benefits of Spring very clear and make this extra thread issue an non-issue.
Not to get sidetracked, but the benefits I'm focusing on are how Spring helps testability of new code, is well tested, and is widely used. I have to compare Spring to home-grown code that uses a lot of Singletons and no DI. Spring's flexibility needs to be compared to its complexity (perceived or real).
Now back to the thread issue. It would be nice to give some numbers. How many applications are in deployed and running well with that extra thread? What is the largest app. among them? How long have these apps. been running without problems? It would also be nice to explain how/why the spec. doesn't preclude that extra thread. (I'll have to go dig in the spec. again to work on that.) Have there been any statements from Sun, BEA, or IBM supporting the claim that the extra thread is OK?
Nov 18th, 2005, 10:36 AM
Hmmm. Over a week and no takers. Maybe I'm asking the wrong questions.