I am writing a query in ColdFusion 9.01 script and having trouble understanding why it is not caching the results. The same exact query will cache when executed using the CFML tag syntax.
The SQL, datasource, username, password are not changing. I have dumpped the cfscript query object after instantiating it and verified the cachedWithin argument was properly received during init. I'm stumped.
CFScript Version that will not cache
var Q = new Query(
SQL="SELECT * FROM TABLE"
,cachedwithin=createTimeSpan(0,0,60,0)
).execute().getResult();
CFML Tag Version that will cache
<cfquery name="local.q">SELECT * FROM TABLE</cfquery>
Thank you for your time and help.
Aaron
Give it a name! :)
var Q = new Query(
SQL="SELECT * FROM TABLE"
,cachedwithin=createTimeSpan(0,0,60,0)
,name="myQuery"
).execute().getResult();
http://www.compoundtheory.com/?action=displayPost&ID=500
here: http://adiefatlady.posterous.com/compound-theory-getting-cfscript-queries-to-c
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With