I'm used to Adobe ColdFusion and have been caching queries using cachedafter
with a "simple" date:
<cfparam name="application.icons_last_changed" default="#now()#">
<cfquery name="get_icons" cachedafter="02/02/1978" datasource="#application.datasources.main#">
SELECT icon_id, icon_name
FROM REF_Icon
WHERE #application.icons_last_changed#=#application.icons_last_changed#
ORDER BY sort_order
</cfquery>
I transitioned my project from ColdFusion/MSSQL to Railo/PostgreSQL. Today, something in the Railo diagnostics caught my eye.
- I'm used to seeing "get_ref_icon (Datasource=Workstream, Time=cached, Records=39) in /path/qry_get_ref_icon.cfm"
- but in Railo I see "get_ref_icon (Datasource=Workstream, Time=0.974 ms, Records=39) in /pathqry_get_ref_icon.cfm".
Thinking that perhaps the simple data value ("02/02/1978") for cachedafter
isn't supported by Railo, I tried setting the date with createodbcdatetime('1978-02-02 16:37:00')
, but that didn't seem to make a difference.
Of course, 0.974 ms is such a small time that perhaps the query is cached, and Railo just isn't as explicit as ColdFusion.
Is my query getting cached, or am I going about it the wrong way?