Hi Prashant, I see you were the original poster, and this thread
happened to catch my eye, so I just thought I'd add an idea - and 1st
post to this group:

At times I've just used a queries.cfc which contains, among others,
these methods:

onMissingMethod() access="public"
remoteMethod() access="remote"
getData() access="private"
setData() access="private"
setJoinRecords() access="private"
getTreeData() access="private"
getTreeBranchData() access="private"
getOtherTreeBranchData() access="private"

notes/details:
- this cfc uses rules to determine which sql to execute
- it uses cfdbinfo to populate the cfqueryparams, uses roles/
verifyclient attributes to restrict access (such as remote calls), and
flexibly handles query caching
- it also handles multiple dsns
- remoteMethod() is the channel for remote calls, and uses switch/case
to only allow certain calls
- getData() handles select/selecttop across 1-3 tables
- setData() handles sets/updates for 1 table
- setJoinRecords() handles sets/updates across 3 tables
- this cfc is for MSSQL 2005, so it uses a CTE (Common Table
Expression) for the tree branch stuff (ex: family tree, or store/
productgroups/products heirarchy)
- -getTreeData gets the whole tree
- -getTreeBranchData gets just 1 branch of the tree
- -getOtherTreeBranchData (for lack of better name) gets all branches
from the tree except for a specific branch

A simple example:
<cfinvoke component="cfcomponents.queries" method="getContact"
returnvariable="thisContact" id="1" />
or
<cfinvoke component="cfcomponents.queries" method="getContact"
returnvariable="thisContact" id="1" disableCaching="true"
getInactive="true" />

It, of course, does not handle all scenarios, but can be helpful.
Though to each their own, I'm just offering this info, in case it can
be of use.

Regards and take care,
-Aaron

On Jan 18, 7:38 pm, "prashant roy" <[email protected]> wrote:
> Mike, I agree with you.
>
>
>
> On Sun, Jan 18, 2009 at 4:29 PM, Mike Chabot <[email protected]> wrote:
>
> > If you want to log queries and find which ones are underperforming I
> > would recommend doing this on the database end. This feature is built
> > into SQL Server. There are loads of third-party dashboards, monitoring
> > tools, error alerting tools, etc, that will let you hone in on the
> > slow queries and also offer tips on how to speed them up. Idera and
> > Quest are two of the leading companies that provide this software.
> > These tools also monitor what else is going on with the server at the
> > same time, such as RAM usage, CPU usage, etc., and will let you trace
> > back through time since they are recording history, letting you take a
> > closer look at temporary server slowness without needing to be
> > actively monitoring the server as the slowness is happening. They also
> > provide you with performance baselines and can detect deviations from
> > the baselines and send alerts to sys admins. No need to add an extra
> > burden on to your application server.
>
> > Performance monitoring is built into CF8 and you can buy well-regarded
> > performance monitoring add-ons for earlier versions of CF that will
> > tell you about slow queries.
>
> > For error handling, you can use the cferror tag to trap and handle
> > database errors site-wide.
>
> > Are you familiar with the result attribute of cfquery? That gives you
> > the execution time without needing to wrap queries in a timer.
>
> > You can put a CFC or custom tag wrapper around database queries if you
> > want to. That is how you would extend the functionality. That example
> > in your email of needing a cfoutput tag has a solution, although I
> > don't really want to explain it since my response is already long
> > enough.
>
> > -Mike Chabot
>
> > On Sun, Jan 18, 2009 at 6:42 PM, Eric O'Connell <[email protected]>
> > wrote:
> > > I realize this is an old thread, but I just had put in my $.02 :) One
> > thing
> > > that I frequently find frustrating about <cfquery> is that it is not
> > > extensible. What if I want to log all of my database queries, and keep
> > track
> > > of which ones are consistently underperforming? What if I need consistent
> > > error recovery (as mentioned above) from database accesses? With the
> > opaque
> > > nature of <cfquery> there is just nothing you can do, and these are just
> > a
> > > couple things that pop into mind.. Over my years of CF development this
> > is a
> > > feature I've wished for again and again. It would be so bad if you could
> > > implement a custom tag that would have "output" scope by default:
>
> > > <cf_myquery>
> > >    select foo from bar where baaz = '#quux#'  <!--- fails because you
> > need
> > > to wrap this in <cfoutput> --->
> > > </cf_myquery>
>
> > > Admittedly I've kind of given up on ever being able to do anything like
> > > this, but does anyone have any suggestions? I would really love to be
> > able
> > > to wrap all my db queries in a timer and log those that take longer than,
> > > say, 100ms.
>
> > > Eric
>
> --
> Prashant Royhttp://www.aarambh.net/http://hindipoems.co.in
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CFCDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cfcdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to