> Over the weekend I was speaking to a friend of mine also an
> Oracle Guru and he asked me a basic question on Using CFQUERY.
> His question was that while making a connection to a database
> how does it (CFQUERY) handle opening and closing a connection
> to a database (you know like opening and closing a socket
> connection )? Does anyone know how this is done in CF?
Database connections are affected by several variables. Within a specific
datasource, you can set it to maintain database connections, and you can set
the connection timeout of that datasource, which will instruct CF to destroy
connections after the timeout has expired, whether they're in use or not -
if a connection is in use, CF will wait until the current operation has
completed, then destroy the connection. There's also a general setting in
the CF Administrator for destroying cached connections after a specified
period of inactivity. Finally, you can specify a maximum number of
concurrent connections if you want.
If you select the "maintain database connections" option within a
datasource, CF will pool connections when possible, so that if there's an
existing database connection that can be used for this query, and that
connection isn't executing a query right then, CF will use that connection.
CF will look at the login and DSN information to determine if an existing
connection can be used, so specifying username and password information in
your CFQUERY tags will limit the usefulness of maintaining database
connections somewhat.
> Another question would be how does one log number of concurrent
> users connected to the DB or as a matter of fact to CF server (if
> someone wants to restrict number of users at a time)? I am using
> MS SQL 7.0 server, IIS 4.0.
There's nothing you can do directly to log or limit the number of concurrent
users, but you could write logic into your application to manage this, by
incrementing and decrementing an application variable tracking the number of
users within your application. You'll want to be a bit careful with this, as
there are difficulties in determining whether someone has exited your
application unless you provide a "logout" path and your users actually use
it consistently.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
------------------------------------------------------------------------------
To unsubscribe, send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body or visit the list page at www.houseoffusion.com