Re: One Global Connection vs. Open-Close



On Apr 29, 9:48 am, "rf" <r...@xxxxxxxxxxx> wrote:
"john" <puop...@xxxxxxxxx> wrote in message

news:1177851382.764835.310600@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

All:

I have a MS background and am having fun in the open source world of
PHP and MySQL --- and I have a question.

With PHP and MySQL, is it considered better practice to open a single
database connection and re-use it throughout the life of the
application (simple Web application - low traffic), or is it better to
open a connection, use it and close it as needed?

Define "application".

In the context of the stateless http protocol there is no "application".
There are only individual seperate request to get a specific page at a
specific URL.

--
Richard.

My definition of an application in this context is: a set of Web pages
and Web-based, server-side resources that act as a semantic or logical
unit, whose state is tied together for some period of time using a
session-based mechanism.

.



Relevant Pages

  • how to test jndi connection pooling
    ... I did this by defining a context in META-INF/context.xml of my ... But now I want to write some unit tests of my DatabaseService classes ... because without doing this I wont be able to get a database connection. ...
    (comp.lang.java.programmer)
  • Re: Newbie needs help
    ... can make life interesting on Vista for VB6. ... I figured out the database connection stuff, and most of the code still ...
    (microsoft.public.vstudio.general)