[thelist] Connection Inefficiency

Hassan Schroeder hassan at webtuitive.com
Tue Jan 18 16:38:15 CST 2005


Rob Smith wrote:

> Isn't there a cleaver way to detect whether or not a connection to the database is
> open for your session, rather than on each page you open and close it?

Actually, what you *really* want is DBCP -- DataBase Connection
Pooling. Your servlet container manages a "pool" of connections
which are checked out for use when "opened" and then returned
when "closed" by your code.

The overhead of continually making connections is avoided, and
you can limit the number of simultaneous connections that will
exist at any given time.

That's the servlet world, though -- I have no idea if/how PHP
does anything similar.

FWIW,
-- 
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                           dream.  code.




More information about the thelist mailing list