Hi Chris
What you say about the queries being written to
/reactor/project/[project_name]/Queries is good news. Well kinda. It'd be
good if that was what's happening, but it's not. Which is probably my
problem.
I've got subdirs for DAO, Gateway, Metadata, Record and TO, but no mention
of queries.
The files within the subdirs mentioned about are all the "you can stick your
own versions of the default methods in here" ones. I've overridden a few of
the methods, but not the one being called on the template I mentioned
before.
I'm a bit tied up with work @ the mo' to investigate this too much, but I'll
do what you suggest: factor out all the Model-Glue & ColdSpring stuff (and
Ray's code, and - worst of all - my own code! ;-), and just write some
Reactor test rigs and see what I get. I'll try to do that this evening.
I'll report back with my findings, either way. Now that I know I'm not
seeing what I should be seeing, I'll also dust off Google and do some more
investigation along those lines too.
Thanks.
--
Adam
From: Chris Blackwell
Sent: Tuesday, April 22, 2008 11:49 AM
To: [email protected]
Subject: Re: [Reactor for CF] Reactor querying the DB schema for every query
(reposting in correct place this time, hopefully :-)
Hi Adam,
Reactor generates queries and saves them to files in
/reactor/project/[project_name]/Queries. In production mode it simply
checks the file exists and create only if necessary, in dev mode it will
recheck the schema and recreate the file for each request.
You should only see schema queries when in dev mode, in production mode i
believe reactor uses the metadata cfc to generate the queries, avoiding the
schema query (not 100% on that though)
It definitely sounds like something else in your application is causing
reactor to slip back into dev mode. I would suggest creating a simple test
case outside of whatever framework you're using and test that way.
Cheers, Chris
On 22/04/2008, Adam Cameron <[EMAIL PROTECTED]> wrote:
I've finished up the work, so I've set Reactor to be in "production" mode
(as I have with ColdSpring too), but Reactor still seems to be hitting the
DB twice for each query:
If reactor is a bean in ColdSpring, you'll need to reinitialise your
ColdSpring beanFactory.
Restarting CF is the quickest way to do that.
Hi Tom, cheers for that.
No, I've not quite got to that stage of nutting things out yet, so my calls
are straight to Reactor.
And, yeah, I restarted CF after updating the XML files and re-running the
request a few times to watch the query activity.
So I SHOULDN'T be seeing Reactor requerying the DB schema for each select
query it does?
I've just cranked up the site again, and am grabbing the SQL debugging.
I'm sitting on one page which lists some galleries (this is Ray's tutorial,
remember), and the query debug changes for each reload.
About 1/3 of the time I get one query for the schema, one query for the
actual SELECT. The other 2/3 of the time it just runs the SELECT query by
itself (it might be 1/4 vs 3/4, but you get my drift).
Does Reactor re-check the schema every now and then, at runtime?
Am I correct in thinking that Reactor doesn't actually generate the SELECT
query SQL to file, and then use that, rather it queries the schema
(periodically), and generates the SELECT query SQL dynamically every time a
SELECT query is run, based on that cached schema?
Thanks for your speedy reply mate. Good stuff.
--
Adam
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
Reactor for ColdFusion Mailing List
[EMAIL PROTECTED]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
Reactor for ColdFusion Mailing List
[EMAIL PROTECTED]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[EMAIL PROTECTED]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --