Does anyone know how to cache a query using cfquery but in cfscript?
This works, query is cached for a day:
<cfquery name="otherQry" datasource="stuff" cachedwithin="1">
SELECT GETDATE()
</cfquery>
<cfdump var="#otherQry#">
But this doesn't, it's always cached = false:
<cfscript>
qry = new query();
qry.setDatasource("stuff");
qry.setSql("SELECT GETDATE()");
qry.setCachedWithin("1");
qry = qry.execute().getResult();
writedump(qry);
</cfscript>
I know it's there, since doing <cfdump var="#new
query().setCachedWithin#"> will dump the function. For the cachedwithin
value, I've tried createTimeSpan(1,0,0,0) but it doesn't work too.
I'm on CF9.0.1, if it matters.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337760
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm