Web tier: servlets, JSP, Web frameworks: Handling Connection in Web Apps.
Hi All, I'm working on an Web application in which the JSP is acting as a controller. We are using connection pooling with Weblogic 8.1. We are using the connect and disconnect methods from the jsp it self.So when the page is getting submitted depends on the action it'll call an method from a bean which will talk to db,So all the methods in the bean can use my connection object. Do we have any other alternate method to connect to the DB than this(Calling the connection in Controller) or which is the better approach to use this connection. In production some times we are getting "Out of Memory Error " from weblogic console and the application is going slow.Is this related to connection handling or some other issue. Thank You, Kumar.
- Posted by: Kumarasamy Mani
- Posted on: April 26 2007 03:28 EDT
JSP is acting as a controller. We are using connection pooling with Weblogic 8.1. We are using the connect and disconnect methods from the jsp it self.your design is incorrect, you should not use the JSP as the controller, you should not connect directly to the database via JSP..looks like you will be using JNDI to connect to the connection pool from the JSP..which is a no/no.. be sure you have the latest divers. use the MVC pattern as it is meant to be using a framework such as Struts. have your "Action"(controller" classes use a DAO that connections to the database via JNDI... "Design Patterns are your friends.", happy coding.