Have a look at this:

<cffunction name="clearConnectionPool">

        <cfargument name="password" required="true">
        <cfargument name="datasource" required="true">
        <cfargument name="host" required="true">
        <cfargument name="database" required="true">

        <cfset var admin = createObject("component",
"cfide.adminapi.administrator").login(ARGUMENTS.password)>
        <cfset var ds = CreateObject("component", "cfide.adminapi.datasource")>

        <cfset ds.setMSSQL(name = ARGUMENTS.datasource, host = ARGUMENTS.host,
database = ARGUMENTS.database, pooling = false)>

        <cfset ds.setMSSQL(name = ARGUMENTS.datasource, host = ARGUMENTS.host,
database = ARGUMENTS.database, pooling = true)>

</cffunction>

<cfset clearConnectionPool("myPassword", "datasource", "127.0.0.1",
"database")>

But, I think the last I left it, it wasn't working. It was timing out if I
remember rightly. Also, you might not need to pass in that much data, but
instead glean it from the datasource.

Just an idea.

Adrian
http://www.adrianlynch.co.uk/

-----Original Message-----
From: Adrian Lynch
Sent: 16 January 2008 16:33
To: CF-Talk
Subject: RE: cfqueryparam, cached execution plans, and changing table
structure


You should be able to do it with code. Using the Admin API you can switch a
flag (can't remember which one) off and on again for a given datasource.
This should clear the cached plan.

I had a function to do it but it's at home. If you wait about 5 hours! :OD

I also didn't get around to testing it so I was never 100% sure it worked.

Adrian

-----Original Message-----
From: Ben Mueller
Sent: 16 January 2008 16:17
To: CF-Talk
Subject: cfqueryparam, cached execution plans, and changing table
structure


We hit a problem with morning relating to cfqueryparam.  A query using
cfqueryparam referenced a table whose structure had been changed (we added a
column).  It appears the execution plan had been cached, and either CF7 or
SQL Server 2000 wasn't smart enough to figure out that the table had
changed, and so the query bombed.  I found an old post on it here:

http://www.coldfusionjedi.com/index.cfm?mode=entry&entry=7D417738-DF64-B270-
3056B422E2F6FCAB

......and it seems the only solutions are to cycle the CF service or change
any query (in some minor way) to force CF to create a new execution plan.
Frankly, both of those solutions blow.  We're constantly updating our site,
and if we have to cycle the CF service on our production servers every time
we make a database change, we'll simply be forced to abandon cfqueryparam
entirely.

Somebody please tell me there's some other solution here.

Thanks in advance,
Ben


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:296667
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to