Instead, set up a service cfc that has a function to return your query. You
can then manage this service with Coldspring. So on your front-end code, you
might just be calling cs.getBean('myService').getAllMyData()
-----Original Message-----
From: scottishcfug@googlegroups.com [mailto:scottishcfug@googlegroups.com]
On Behalf Of Martin
Sent: 08 September 2009 12:34
To: Scottish ColdFusion User Group
Subject: [SCFUG] storing a query in the Application scope ...is this a bad
thing?
Bottom line - I have a simple "select all" query that returns about 30
rows of simple data and doesn't really change very often.
However ...it does this by pulling the results from other queries that
read data from different XML datasets and joining them together into a
more useful object.
This query gets called a LOT - and I mean a LOT - so to improve
performance, and because the data doesn't change very often, I decided
to stor the results in the application scope.
eg <cfset application.mydata = application.queryCFC.getAllMyData() />
The results have been that what was taking up to ~600ms before is now
done in ~47ms.
This is a small web app so I am happy I can do this. I just wonder if
this is a bad habit to get into?
--------------------------------------------------------------------------- -
----------------------------
More detail - why I did it.
We have lots of short lived, simple web projects - "summer schools"
being one example - they all want their own design and live in a
range of different domains (and sub-domains). Once or twice we even
have to move the app from one domain to another so I wanted to build
simple self contained projects that I could just pick up and dump
elsewhere if needed.
Our existing database is filling up with these temporary projects so
while I search for an effective conference(?) management system (x-
domain). I thought I would experiment with storing data in XML.
So far I quite like it - I am trying to engineer the apps in a MVC way
so if I want to create a new one all I need to do is delete my XML
files, edit the config file and create my design.
I have found reading the XML files a bit more time consuming than
straight db queries though - especially when joining data from
different files.
The above performance boost example was on one problematic page that I
probably needed to re-engineer anyway however this was a simple and
quick solution that I was able to implement very easily.
--------------------------------------------------------------------------- -
---------------------------------------------------
Is anybody else using XML to store data? I am especially interested to
see how other people store dates in XML. Just curious.
Cheers
Marty