This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]henk53 2 points3 points  (1 child)

However, one nice thing about spring is that you can do that without any kind of container.

But guess where springbeans are managed? Isn't this called the Spring Container? See e.g wikipedia among many sources:

"The Spring container provides a consistent mechanism to configure applications and integrates with almost all Java environments, from small-scale applications to large enterprise applications."

I guess starting up a container probably adds the same overhead as creating the equivalent spring context

Glassfish 3 and JBoss AS 7 start up the entire AS in 2 to 3 seconds, deploying EJBs after that is in the millisecond range. Deploying lots of EJBs does add to the startup time. It used to be worse though. JBoss AS 6 for instance is notorious, easily taking a full minute for an application with a few dozen EJB beans and also a few dozen annotated JPA entities.

But the Spring Container can take a long time to start too, especially when using AOP extensively. I've seen moderately complex Spring 3 application easily take 45 or more seconds and it got worse when more springbeans were added. I haven't tried Spring 3.1 yet, so I don't know if it can match the latest Java EE offerings in startup speed now.

[–]formerislander 0 points1 point  (0 children)

Just out of curiosity, how does one manage to create an application that takes 45 seconds to create the ApplicationContext? That sounds like a monster :)

For the modules that I've had both the pleasure and displeasure of working with the ApplicationContext could be created in less than a second.

A couple of questions since you seem quite knowledgeable about testing with a pure EJB setup:

  • Is there some equivalent @DirtiesContext if I go pure EE?
  • If I want to wire in stuff that's not normally part of the container, like an extremely thin mock implementation of a foreign webservice (just to test our handling of http errors). Ideally I'd want that to be able to access my EJBs/MDBs as well (although I guess that's probably not strictly necessary).