BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to Handle a Timeout error

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO)
View previous topic :: View next topic  
Author Message
Bill N
Guest





PostPosted: Tue Aug 24, 2004 7:44 pm    Post subject: How to Handle a Timeout error Reply with quote



I've created an Client/Server Application using D6 SP2 and all seems to
work well except on one client who has a farm of citrix servers (6
machines) with a database server with MSDE on the machine.

The client has been experiencing timeouts. I would like to know:
=================================================================
1) How I can I determine whether it is the TADOConnection that is
timing out or a specific query?
2) If it is a specific query that is timing out, which one?
3) Other than increasing the CommandTimeout property, is there
anything that I can do to prevent timeouts?
=================================================================

Thanks,
Bill N
Back to top
Bill N
Guest





PostPosted: Wed Aug 25, 2004 4:59 am    Post subject: Re: How to Handle a Timeout error Reply with quote



Quote:

2) If it is a specific query that is timing out, which one?
You would have to keep track that in your code.

Something like:

=============================
log.Write('Executing Query1');
Query1.Open;
log.Write('Query1 Executed');
=============================
Or better yet write something on the OnFetchComplete or AfterOpen event.

Is there a better way of doing this?

Thanks,
Bill N



Back to top
Del Murray
Guest





PostPosted: Wed Aug 25, 2004 12:48 pm    Post subject: Re: How to Handle a Timeout error Reply with quote



Bill,
Did you wrap your queries in a try..except block ??? in the except block you
can trap the timeout error.


Back to top
Bill N
Guest





PostPosted: Wed Aug 25, 2004 1:28 pm    Post subject: Re: How to Handle a Timeout error Reply with quote

Del Murray wrote:

Quote:
Bill,
Did you wrap your queries in a try..except block ??? in the except
block you can trap the timeout error.

Hi Del

What is it though -- ETimeout and how do I get which query timed out?

Thanks,
Bill N

Back to top
Del Murray
Guest





PostPosted: Wed Aug 25, 2004 2:44 pm    Post subject: Re: How to Handle a Timeout error Reply with quote

Do you have each query.open in a try .. except or are you using a global
exception handler. I put each one in a try except, that way I know which one
is failing. I do this ...

try
qryDataSet.close;
qryDataSet.commandtext := blah blah blah // or what ever,
qryDataSet.Open
except'
on e:exception do begin
showmessage(e.message);
end;
end;

This seems crude, but if an "open" fails that means that their is something
bad wrong. the e.message will tell you what. It may be a timeout but may be
something else. What ever it is, I dont want to just handle timeouts, I want
to know why any failure took place and this gives it to me.


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.