GOOD: mysql.jar (221 kb, 10/7/2003) mysql-connector-java-3.0.16-ga-bin.jar (231 kb, 11/16/2004) mysql-connector-java-3.0.17-ga-bin.jar (241 kb, 6/22/2005) BAD (memory leak): mysql-connector-java-3.1.10-bin.jar (409 kb, 6/23/2005) mysql-connector-java-3.1.14-bin.jar (449 kb, 10/18/2006) … (other versions) mysql-connector-java-5.1.6-bin.jar (687 KB, 3/5/2008) So – does anyone know what the major change was between 3.0.17 and 3.1.10 that would have such a dramatic effect?
When response.sendRedirect() is not the last statement in Servlet to be executed and its embedded in between your business logic i.e after response.sendRedirect(), if some function or business logic is continued this exception will be thrown by the java servlet. So, it should be the last statement otherwise it should return null after redirecting. eg. […]