Movak wrote:
The problem is that there seems to be no way to ensure that all sequential queries will go through the same connection as the driver controls the connection and not the calling program.
...
There seems to be no gaurantee that the driver maintains the same connection, and therefore session, between cfqueries.
There may be no guarantees, however there is a way for ColdFusion to instruct the driver to maintain a connection. You can configure this in the ColdFusion Administrator.
To do so, click to select the particular datasource from the Data Sources page. Then click on 'Show Advanced Settings'. Ensure that the setting 'Maintain Connections' is checked. There you are.
There are some caveats, however. For example, if your query tags each has a username and password attribute, then a new connection will be created for each request to the database. See the article How are database connections handled in ColdFusion?.