Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the cfscript equivalent to <cfobjectcache action="clear">?

Tags:

coldfusion

I pretty sure that coldfusion hasn't got a cfscript alternative for the <cfobjectcache> tag, but I was wondering if I can do the same as <cfobjectcache action="clear"> in cfscript. Any ideas?

like image 223
jan Avatar asked Jan 16 '23 01:01

jan


1 Answers

The ObjectCacheTag on action="clear" calls purgeQueryCache() on the DataSourceService, exposed from the ServiceFactory.

<cfscript>
createObject('java','coldfusion.server.ServiceFactory').getDataSourceService().purgeQueryCache();
</cfscript>

This is how it works in CF8, CF9 and CF10

like image 191
Mike Causer Avatar answered Mar 26 '23 22:03

Mike Causer