 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Morten Breiner Guest
|
Posted: Sat Jan 17, 2004 3:23 pm Post subject: TADOConnection, TADOQuery and Timeout expired...... |
|
|
Hi
I have a made a small application in delphi 7. The application monitor:
a) connection to a MSSQL 2000 database
b) alive flags stored by other applications within the same database
During heavy database activity I got a dialog containing a OK button
poping up with the message: "Timeout expired"
Unfortunately this dialog halt the program execution and prevent the
continious checking on alive flags within the database.
I have used TADOConnection and TADOQuery objects for the database
operations only.
Have anybody experiensed the same problem or does anybody have any idear
on how to prevent this dialog from poping up ??. Apparently no event is
triggered !!.
I have tried to adjust TADOCommandTimeout and TADOConnectionTimeout
without success.
Thanks in advance
-Morten
|
|
| Back to top |
|
 |
Ryan Guest
|
Posted: Mon Jan 19, 2004 9:11 am Post subject: Re: TADOConnection, TADOQuery and Timeout expired...... |
|
|
Try looking at the query you are running. Extract this an run in in
SQL and see if this gives a timeout error. You can also have a look at
the execution plan in SQL Query Analyzer to see where the time is
being taken up.
Generally though, I would expect that the timeout settings on the ADO
components would override the SQL ones (if lower). Time the query and
see if it matches the settings on your components.
Morten Breiner <morten.breiner (AT) privat (DOT) dk> wrote
| Quote: | Hi
I have a made a small application in delphi 7. The application monitor:
a) connection to a MSSQL 2000 database
b) alive flags stored by other applications within the same database
During heavy database activity I got a dialog containing a OK button
poping up with the message: "Timeout expired"
Unfortunately this dialog halt the program execution and prevent the
continious checking on alive flags within the database.
I have used TADOConnection and TADOQuery objects for the database
operations only.
Have anybody experiensed the same problem or does anybody have any idear
on how to prevent this dialog from poping up ??. Apparently no event is
triggered !!.
I have tried to adjust TADOCommandTimeout and TADOConnectionTimeout
without success.
Thanks in advance
-Morten
|
|
|
| Back to top |
|
 |
Morten Breiner Guest
|
Posted: Tue Jan 20, 2004 12:16 am Post subject: Re: TADOConnection, TADOQuery and Timeout expired...... |
|
|
Thanks, I will try to work in that direction trying to eliminate the
Timeout. However, I would still need to trap the "Timeout Expired"
Dialog as it potentially can halt my application. I have no idear on how
to do this and would therefor be very happy for any suggestions.
Thanks
-Morten
In article <7802b79d.0401190111.40ef7e20 (AT) posting (DOT) google.com>,
[email]ryanofford (AT) hotmail (DOT) com[/email] says...
| Quote: | Try looking at the query you are running. Extract this an run in in
SQL and see if this gives a timeout error. You can also have a look at
the execution plan in SQL Query Analyzer to see where the time is
being taken up.
Generally though, I would expect that the timeout settings on the ADO
components would override the SQL ones (if lower). Time the query and
see if it matches the settings on your components.
Morten Breiner <morten.breiner (AT) privat (DOT) dk> wrote
Hi
I have a made a small application in delphi 7. The application monitor:
a) connection to a MSSQL 2000 database
b) alive flags stored by other applications within the same database
During heavy database activity I got a dialog containing a OK button
poping up with the message: "Timeout expired"
Unfortunately this dialog halt the program execution and prevent the
continious checking on alive flags within the database.
I have used TADOConnection and TADOQuery objects for the database
operations only.
Have anybody experiensed the same problem or does anybody have any idear
on how to prevent this dialog from poping up ??. Apparently no event is
triggered !!.
I have tried to adjust TADOCommandTimeout and TADOConnectionTimeout
without success.
Thanks in advance
-Morten
|
|
|
| Back to top |
|
 |
Ryan Guest
|
Posted: Tue Jan 20, 2004 8:24 am Post subject: Re: TADOConnection, TADOQuery and Timeout expired...... |
|
|
The quick and easy way is in a Try...Except loop. It will catch all errors though.
Morten Breiner <morten.breiner (AT) privat (DOT) dk> wrote
| Quote: | Thanks, I will try to work in that direction trying to eliminate the
Timeout. However, I would still need to trap the "Timeout Expired"
Dialog as it potentially can halt my application. I have no idear on how
to do this and would therefor be very happy for any suggestions.
Thanks
-Morten
In article <7802b79d.0401190111.40ef7e20 (AT) posting (DOT) google.com>,
[email]ryanofford (AT) hotmail (DOT) com[/email] says...
Try looking at the query you are running. Extract this an run in in
SQL and see if this gives a timeout error. You can also have a look at
the execution plan in SQL Query Analyzer to see where the time is
being taken up.
Generally though, I would expect that the timeout settings on the ADO
components would override the SQL ones (if lower). Time the query and
see if it matches the settings on your components.
Morten Breiner <morten.breiner (AT) privat (DOT) dk> wrote
Hi
I have a made a small application in delphi 7. The application monitor:
a) connection to a MSSQL 2000 database
b) alive flags stored by other applications within the same database
During heavy database activity I got a dialog containing a OK button
poping up with the message: "Timeout expired"
Unfortunately this dialog halt the program execution and prevent the
continious checking on alive flags within the database.
I have used TADOConnection and TADOQuery objects for the database
operations only.
Have anybody experiensed the same problem or does anybody have any idear
on how to prevent this dialog from poping up ??. Apparently no event is
triggered !!.
I have tried to adjust TADOCommandTimeout and TADOConnectionTimeout
without success.
Thanks in advance
-Morten
|
|
|
| Back to top |
|
 |
Morten Breiner Guest
|
Posted: Wed Jan 21, 2004 12:16 am Post subject: Re: TADOConnection, TADOQuery and Timeout expired...... |
|
|
Hi Ryan
I have all the DB connection/checking code encapsulated in try except
statements as you suggest. However, maybe I should try an see if any
unhandled exceptions occur.
Thanks for your help.
-Morten
In article <MPG.1a769185eb2d575d989681 (AT) news (DOT) tele.dk>,
[email]morten.breiner (AT) privat (DOT) dk[/email] says...
| Quote: | Thanks, I will try to work in that direction trying to eliminate the
Timeout. However, I would still need to trap the "Timeout Expired"
Dialog as it potentially can halt my application. I have no idear on how
to do this and would therefor be very happy for any suggestions.
Thanks
-Morten
In article <7802b79d.0401190111.40ef7e20 (AT) posting (DOT) google.com>,
[email]ryanofford (AT) hotmail (DOT) com[/email] says...
Try looking at the query you are running. Extract this an run in in
SQL and see if this gives a timeout error. You can also have a look at
the execution plan in SQL Query Analyzer to see where the time is
being taken up.
Generally though, I would expect that the timeout settings on the ADO
components would override the SQL ones (if lower). Time the query and
see if it matches the settings on your components.
Morten Breiner <morten.breiner (AT) privat (DOT) dk> wrote
Hi
I have a made a small application in delphi 7. The application monitor:
a) connection to a MSSQL 2000 database
b) alive flags stored by other applications within the same database
During heavy database activity I got a dialog containing a OK button
poping up with the message: "Timeout expired"
Unfortunately this dialog halt the program execution and prevent the
continious checking on alive flags within the database.
I have used TADOConnection and TADOQuery objects for the database
operations only.
Have anybody experiensed the same problem or does anybody have any idear
on how to prevent this dialog from poping up ??. Apparently no event is
triggered !!.
I have tried to adjust TADOCommandTimeout and TADOConnectionTimeout
without success.
Thanks in advance
-Morten
|
|
|
| Back to top |
|
 |
Leonardo C. Monteiro Guest
|
Posted: Wed Jan 21, 2004 3:10 am Post subject: Re: TADOConnection, TADOQuery and Timeout expired...... |
|
|
"Morten Breiner" <morten.breiner (AT) privat (DOT) dk> wrote
| Quote: | Hi
I have a made a small application in delphi 7. The application monitor:
a) connection to a MSSQL 2000 database
b) alive flags stored by other applications within the same database
During heavy database activity I got a dialog containing a OK button
poping up with the message: "Timeout expired"
Unfortunately this dialog halt the program execution and prevent the
continious checking on alive flags within the database.
I have used TADOConnection and TADOQuery objects for the database
operations only.
Have anybody experiensed the same problem or does anybody have any idear
on how to prevent this dialog from poping up ??. Apparently no event is
triggered !!.
I have tried to adjust TADOCommandTimeout and TADOConnectionTimeout
without success.
Thanks in advance
-Morten
|
Hi Morten,
I think the problem is because there is a bug in some versions of ADO that
affect the CommandTimeout property. For more details see:
1. "PRB: CommandTimeout Does Not Inherit From Connection Timeout"
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q195489
2. "FIX: CommandTimeout Property Problem with Connection Object"
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q175/2/64.asp&NoWebContent=1
What happens is that TADOQuery doesn't inherit the value of CommandTimeout
from TADOConnection.
Some years ago (three years?) I fixed this bug just changing the scope of
the property TADOQuery.CommandTimeout to public and using this property in
my programs instead of TADOConnection.CommandTimeout. This is the code:
unit ADODB; // Modified to fix the CommandTimeout bug
...
TADOQuery = class(TCustomADODataSet)
...
public
property CommandTimeout;
end;
...
end.
Of course you will need to recompile and use the modified ADODB unit.
Good luck,
Leonardo.
|
|
| Back to top |
|
 |
Morten Breiner Guest
|
Posted: Sat Jan 24, 2004 12:01 am Post subject: Re: TADOConnection, TADOQuery and Timeout expired...... |
|
|
In article <400de68c (AT) news (DOT) iis.com.br>, "Leonardo C. Monteiro" <cardoso
AT iis.com.br> says...
| Quote: | "Morten Breiner" <morten.breiner (AT) privat (DOT) dk> wrote in message
news:MPG.1a7371daa7145293989680 (AT) news (DOT) tele.dk...
Hi
I have a made a small application in delphi 7. The application monitor:
a) connection to a MSSQL 2000 database
b) alive flags stored by other applications within the same database
During heavy database activity I got a dialog containing a OK button
poping up with the message: "Timeout expired"
Unfortunately this dialog halt the program execution and prevent the
continious checking on alive flags within the database.
I have used TADOConnection and TADOQuery objects for the database
operations only.
Have anybody experiensed the same problem or does anybody have any idear
on how to prevent this dialog from poping up ??. Apparently no event is
triggered !!.
I have tried to adjust TADOCommandTimeout and TADOConnectionTimeout
without success.
Thanks in advance
-Morten
Hi Morten,
I think the problem is because there is a bug in some versions of ADO that
affect the CommandTimeout property. For more details see:
1. "PRB: CommandTimeout Does Not Inherit From Connection Timeout"
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q195489
2. "FIX: CommandTimeout Property Problem with Connection Object"
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q175/2/64.asp&NoWebContent=1
What happens is that TADOQuery doesn't inherit the value of CommandTimeout
from TADOConnection.
Some years ago (three years?) I fixed this bug just changing the scope of
the property TADOQuery.CommandTimeout to public and using this property in
my programs instead of TADOConnection.CommandTimeout. This is the code:
unit ADODB; // Modified to fix the CommandTimeout bug
...
TADOQuery = class(TCustomADODataSet)
...
public
property CommandTimeout;
end;
...
end.
Of course you will need to recompile and use the modified ADODB unit.
Good luck,
Leonardo.
|
Hi Leonardo
Thanks for your response. This could actually be the case and I will
take a look at your suggestion to solve the timeout problem as soon as
possible.
Thanks again
-Morten
|
|
| Back to top |
|
 |
|
|
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
|
|