Highlighted

cacheRegion with query service?

New Here ,
Mar 11, 2020

Copy link to clipboard

Copied

In CF10, is there a way to set the cache region when using cfscript query functions?

 

For example:

sqlString = 'select * from dual';

qs = new query();
qs.setName('testME');
qs.setcachedwithin(createTimespan(0,0,5,0));

qs.setAttributes('cacheRegion', 'users');  //This doesnt seem right?

 

Views

195

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

cacheRegion with query service?

New Here ,
Mar 11, 2020

Copy link to clipboard

Copied

In CF10, is there a way to set the cache region when using cfscript query functions?

 

For example:

sqlString = 'select * from dual';

qs = new query();
qs.setName('testME');
qs.setcachedwithin(createTimespan(0,0,5,0));

qs.setAttributes('cacheRegion', 'users');  //This doesnt seem right?

 

Views

196

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 11, 2020 0
LEGEND ,
Mar 11, 2020

Copy link to clipboard

Copied

Hi, zpm,

 

I've never used cacheRegion, but did a quick Google search and found:

https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-c-d/CacheRegionNew....

 

You learn something new, every day.  I had no idea one could cache according to region.  HTH.

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 11, 2020 0
zpm007 LATEST
New Here ,
Mar 11, 2020

Copy link to clipboard

Copied

Thanks but that only creates a region for other objects when using cacheput.  It doesnt apply the region to the query service object.

 

Im looking for the equilvant of cfquery tag based to syntax to this:

 

<cfquery... cacheRegion="test">

select * from dual

</cfquery>

 

In this example, it creates the region if it does not exist.

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 11, 2020 0