Re: Figuring out the Correct Approach <scratch head>

From: Oscar kind (oscar_at_danwa.net)
Date: 03/08/05


Date: Tue, 8 Mar 2005 19:23:41 +0100

Dave Brown <dave@removethisfromaddressdbws.net> wrote:
>
> My Application has a Listener which when first started will connect to a
> database and place a (Connection) object in the servletcontext
> attributes for access through my other jsp's and servlets..

Ouch! This will cause a connection timeout when a user opens the
application and takes a cup of coffee...

The correct approach is to open the connection for each page access, and
close it before you return to the browser. An improvement in your design
would be to put a connection pool of connection factory in the servlet
context.

-- 
Oscar Kind                                    http://home.hccnet.nl/okind/
Software Developer                    for contact information, see website
PGP Key fingerprint:    91F3 6C72 F465 5E98 C246  61D9 2C32 8E24 097B B4E2


Relevant Pages

  • Re: Persist a database connection across postbacks
    ... having a persistent database connection across postbacks. ... need to interact with the database, call this function, do your data ... can fail if the user opens a second browser window and fires off two db ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Figuring out the Correct Approach <scratch head>
    ... > database and place a object in the servletcontext ... This will cause a connection timeout when a user opens the ...
    (comp.lang.java.help)
  • Re: ADO Connection Timeout
    ... so what happens when a connection failure forces one station to revert ... to a local database? ... Further, you *will* have contention issues, Jet does not support record ... to the central server, but you are willing to live with periods where it ...
    (microsoft.public.data.ado)
  • Re: ADO Connection Timeout
    ... When the first test is run, the results are stored in the central database. ... to the central server, but you are willing to live with periods where it ... i.e. a local database or even a text file. ... to function until the connection can be restored to the server. ...
    (microsoft.public.data.ado)
  • Re: ADO Connection Timeout
    ... to the central server, but you are willing to live with periods where it ... i.e. a local database or even a text file. ... to function until the connection can be restored to the server. ...
    (microsoft.public.data.ado)