This content has been marked as final. Show 4 replies
Just out of curiousity, if you ever update the data in your db, what's your plan for updating the application variable?
For this data I have an "initialize application variables" include file that runs after an insert statement is performed. The include file just executes the query and re-saves that as the same application variable. Thus, updating the query with the new record. Pretty basic and simple but that's okay.
I also have a ticket application query variable where I just append a new row to the query after an insert statement so I don't have to re-run that query as it takes a while to run.
I have a query saved as an application variable (mx 7). Do I need to put a cflock readonly lock around the cfoutput query code?
No, it is not necessary. By definition, <cfquery name="application.queryName">, is used to name a query that the entire application requires, and whose resultset we expect will remain unchanged during the life of the application. This constancy means there's never going to be any race conditions. Hence, there's no need for locks.