Saturday, March 3, 2012

Re: Connection Pool

hey, but how about doing like this?


    private Connection connection;

    public void init(ServletConfig c) throws ServletException {
      //Open the connection here
    }

    public void destroy() {
     //Close the connection here
    }

    public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException {
      //Use the connection here
      Statement stmt = connection.createStatement();

  }


On Friday, March 2, 2012 10:37:05 PM UTC+5:30, Joe Faith wrote:
Database connections in a cloud hosted environment should be managed differently to those on a conventional server. In particular, be aware that your database instance may be taken offline while not in use, and any pooled connections would be closed. We recommend that a new connection is created to service each HTTP request, and re-used for the duration of that request (since the time to create a new connection is similar to that required to test the liveness of an existing connection).

J

Good question ! I'm in need of the answer as well...

Le mardi 1 novembre 2011 19:44:30 UTC+1, javabuddy a écrit :
How to establish Connection Pool in GAE using AppEngineDriver in Cloud
SQL or native datastore??

Thanks



--
Joe Faith | Product Manager | Google Cloud

No comments:

Post a Comment