My application contains, Servlet, beans and jsp's , now for each request a requestType and beanType are passed as parameters and depending upon those parameters the servlet creates a new instance of the bean every time and i am making the bean object created to refer to NULL in the finally block. Does this sounds like a good approach?, any performance issues? what are the other procedures for a basic web application, I am not using any framework although its very much similar to Model 2 architecture.
"Failure is not when you fall down; its only when you fail to get up again."
posted 11 years ago
Assigning a null to a variable instance in a finally block should never be a performance issue. However, I am not sure why you are doing this as you say the object is recreated with each request and so a garbage collection candidate when it goes out of scope.