Re: Query Retries

2009-04-03 Thread Nathan Strutz

Thanks for clarifying.

So by "recoverable," do you mean a problem where the server is temporarily
unavailable? If that's the case, eeek. That's a bad situation to be in.
Generally, it just doesn't happen, so this isn't a problem you typically
have to solve.

What you may want to consider in this case is some basic error catching and
some kind of framework to handle failed queries in a predictable,
user-friendly manner, like a nice error page, maybe a way to let the user
retry the exact request.


nathan strutz
[Blog and Family @ http://www.dopefly.com/]
[AZCFUG Manager @ http://www.azcfug.org/]



On Fri, Apr 3, 2009 at 4:50 AM, Byte Me  wrote:

>
> > Is there a rule of thumb on how many times a query should be retried?
>
> Thank you for the info everyone. I'm using Mysql and I'm not getting any
> errors, I'm just trying to use good programming practices so the end user
> will not see any error messages, in the event that a recoverable error is
> generated by the database.
>
> 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321312
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Query Retries

2009-04-03 Thread Byte Me

> Is there a rule of thumb on how many times a query should be retried? 

Thank you for the info everyone. I'm using Mysql and I'm not getting any 
errors, I'm just trying to use good programming practices so the end user will 
not see any error messages, in the event that a recoverable error is generated 
by the database. 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321275
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Query Retries

2009-04-03 Thread Nathan Strutz

Hah, that's cool. I'd say it depends on how long you expect your database to
be down for, what DBMS you're using, how important the data is, how long the
user will wait for their data, and so on and so on. In other words, it
depends.

Generally speaking, you should never have to retry a query. It should just
work. Applications that rely on database tend to work best when the database
works.

If you're using MS Access as your database, that's your problem right there.

If you have a real database (aka not MS Access), discuss the problem with
your DBA. If you are the DBA, maybe we can help you debug your database
problem here on cf-talk.

To throw out an absolutely arbitrary figure, don't try it 3 times.

This reminds me of this time we had SQL failover for a buggy server, when
one server goes down, the database cluster would be unavailable for a few
seconds while we wait for the other server. I had this idea of a whole
annoying database running framework to automatically retry a given number of
tries, if a few queries fail in a row across the site, we'll throw up a
friendly under construction type message instead of the data they were
looking for, meanwhile, it kicks off a job to retry the connection, and once
it connects successfully, turns maintenance mode off and stops the job. I
never got the chance to do it, which is too bad, it would have been fun.

nathan strutz
[Blog and Family @ http://www.dopefly.com/]
[AZCFUG Manager @ http://www.azcfug.org/]



On Thu, Apr 2, 2009 at 1:46 PM, Byte Me  wrote:

>
> Is there a rule of thumb on how many times a query should be retried? I'm
> using nested cftry/catch and will retry a maximum of 4 times. Each retry is
> delayed by a random number of milliseconds. Thanks for any insight.
>
> 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321269
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Query Retries

2009-04-03 Thread Jaime Metcher

A transaction that has rolled back due to a deadlock should always be
retried at least once.  Unless your server is chronically ill or you use
massively long transactions, the chances of getting the same deadlock twice
in a row are pretty small.

Jaime 

> -Original Message-
> From: b...@bradwood.com [mailto:b...@bradwood.com] 
> Sent: Friday, 3 April 2009 6:06 AM
> To: cf-talk
> Subject: RE: Query Retries
> 
> 
> Just speaking for myself here-- I never retry a query.  Most 
> errors I tend to get with a database call is due to something 
> like a column not existing or some data truncation error that 
> is going to happen no matter how many times I try it.
> 
> The only times I have ever really seen SQL Server throw an 
> error that is recoverable is when it is trying to to connect 
> to some remote linked server via ODBC and the connection has 
> timed out.  In those specific instances, the query always 
> works the second time.
> 
> Why don't you tell us what kind of errors you usually have 
> thrown from the database.
> 
> ~Brad
> 
>  Original Message 
> Subject: Query Retries
> From: Byte Me 
> Date: Thu, April 02, 2009 3:46 pm
> To: cf-talk 
> 
> 
> Is there a rule of thumb on how many times a query should be retried?
> I'm using nested cftry/catch and will retry a maximum of 4 
> times. Each retry is delayed by a random number of 
> milliseconds. Thanks for any insight. 
> 
> 
> 
> 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321268
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Query Retries

2009-04-02 Thread brad

Just speaking for myself here-- I never retry a query.  Most errors I
tend to get with a database call is due to something like a column not
existing or some data truncation error that is going to happen no matter
how many times I try it.

The only times I have ever really seen SQL Server throw an error that is
recoverable is when it is trying to to connect to some remote linked
server via ODBC and the connection has timed out.  In those specific
instances, the query always works the second time.

Why don't you tell us what kind of errors you usually have thrown from
the database.

~Brad

 Original Message 
Subject: Query Retries
From: Byte Me 
Date: Thu, April 02, 2009 3:46 pm
To: cf-talk 


Is there a rule of thumb on how many times a query should be retried?
I'm using nested cftry/catch and will retry a maximum of 4 times. Each
retry is delayed by a random number of milliseconds. Thanks for any
insight. 



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321260
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Query Retries

2009-04-02 Thread Alan Rother

I wouldn't say there is a rule of thumb for this, if your Query is failing
more than 4 times, and it happens often enough for you to need to think
about this, then I think you need to stop look at how to deal with and look
for ways to fix it.
Why is it that your running into this problem? I can't imagine a production
system where it would be acceptable to have that level of query failure.

=]

-- 
Alan Rother
Adobe Certified Advanced ColdFusion MX 7 Developer
Manager, Phoenix Cold Fusion User Group, AZCFUG.org


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321257
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Query Retries

2009-04-02 Thread Ben Nadel

Why are your queries failing?

On Thu, Apr 2, 2009 at 4:46 PM, Byte Me  wrote:

>
> Is there a rule of thumb on how many times a query should be retried? I'm
> using nested cftry/catch and will retry a maximum of 4 times. Each retry is
> delayed by a random number of milliseconds. Thanks for any insight.
>
> 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321256
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4