[thelist] DBCon to SQL good/bad practice

Jeff Howden jeff at jeffhowden.com
Mon Nov 24 10:10:21 CST 2003


> From: Joshua Olson
> > If you are making DB connections to a database such
> > as SQL, should you close any connection you open?
> > Is it bad practise to leave them open?
> This will depend on your environment.  Some
> environments, such as CF, use pooled connections and you
> have no control as to whether or not the connections are
> opened or closed. [...]

actually, you can control whether or not any given datasource uses pooled
connections or not.  simply uncheck the "maintain connections" checkbox in
the coldfusion administrator and it will open and close connections for
every request.

imo, changing this setting is a *very* bad idea.  cf uses pooled connections
by default for a reason;  it's alot more efficient to not have to open and
close the connection all the time.

> IOW, yes, it's good practice (spelling!!) to close the
> connection.

as long as the environment you're working in is not optimized for pooled
connections, yes.


Jeff Howden - Web Application Specialist
Résumé - http://jeffhowden.com/about/resume/
Code Library - http://evolt.jeffhowden.com/jeff/code/

More information about the thelist mailing list