Zero Turnaround, Revisited

November 22nd, 2006 by Jevgeni Kabanov

There has been some amount of discussion on the previous post. What was a bit surprising for me, is that a lot of people think that this isn’t really an issue for Java EE (they should really look at the comments here).

First of all let’s clear up some misunderstandings — we are talking about a development time approach, that allows to see the results of changes to code reflected instantly in the web application. This has nothing to do with production time hot swapping.

Secondly, nowadays compiling isn’t much of a bottleneck, since Eclipse (and similar IDEs) compile application incrementally on-the-fly. So the only thing we need is to actually reload this code in the JVM and we will get instant feedback that speeds up development.

Thirdly, web containers had for quite some time supported reloading classes while preserving the session state. However they do it by restarting the web application, which means all state outside the session (including business and persistence layer configuration, cache, stateful application-level services, compiled statements and so on) will be lost. To speak more specifically in a typical application based on Spring and Hibernate that is deployed to Weblogic (or Tomcat, or whatever else) such restart will take 30s to several minutes depending on the size of the application.

Now this is a really big issue — it means that averaging a restart every five minutes we get 96 restarts a day, which even 30s each gives us 48 minutes spent waiting for the application to reload. And the real numbers are even bigger, both because I chose optimistic numbers and because a developer who waits for a minute loses the context and might easily start reading Slashdot out of boredom. Thus companies are losing hell-of-a-lot of money on their developers just waiting for the application to restart.

So, to get back to the solution proposed in the original post. This was a way to get all of your web layer stuff to reload instantly. This by no means solves all problems, as the business and persistence layer are not covered by this approach. However since a lot of development happens in the web layer it does give a good boost to that (I don’t think I’d lie too much if I say that at least half of the restarts become unnecessary). Moreover there are some possibilities to get the rest of the stuff to reload as well, and Aranea team is working on them as well as some others.

3 Responses to “Zero Turnaround, Revisited”

  1. Emmanuel Okyere Says:

    RIFE (http://rifers.org). Unless I’m missing something completely new, RIFE has been letting us do this for ages

    Cheers,
    – eokyere :)

  2. Jevgeni Kabanov Says:

    That’s very cool, though perhaps they should advertise this feature better :)