Caching Queries Dynamic Datasource issues?

Hey all -
Lucee 5.3.6.61 …so recently we migrated a server from ACF. We have a number of queries that are dynamic datasources but cached for short amounts of time to alleviate recalls. We started noticing data switching for customers, and after a bunch of testing…Lucee doesn’t cache the datasource as well? For example, if we need to grab a same-content dataset from DB1, Select * From Customers Where Name = “Joe”, then another call comes in for the data in DB2…we’re presenting the data from DB1 because of the cache.

With ACF, it caches to datasource…so we get all of the Joe’s in DB1 when the call comes in for DB1, and DB2 etc…

  1. is this intentional?
  2. is this a bug? Obviously it would seem that if you’re truly caching the data…SELECT from Datasource2 and getting data from datasource1 is incorrect…and a pretty big issue…at least for us…

Thanks!

So you’re saying the cfquery caching is not taking the datasource name into account? That defo seems like a bug. Please log a ticket and a repro case for it.

as it’s an unusual use case, you could just use a per customer cfquery cache tag attribute? <cfquery> :: Lucee Documentation

Thanks guys. Zac, unfortunately we’re pretty unable to go rebake this stuff…we’re talking dozens of microservices and millions of lines of this with major testing implecations :slight_smile: …having to return to ACF for the time being…

The other thing you could look into is queryListeners.

Given the scale of your project, would you be interested in sponsoring this work?