 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Gunnar Liknes Guest
|
Posted: Tue Aug 30, 2005 8:52 am Post subject: Websnap + ADO |
|
|
Hi,
I have made a small Websnap ISAPI app that has a webdatamodule with
an ADOconnection and a webpage with a ADOStoredproc which uses
the connection in the datamodule.
Everything works fine to start with, however after some hours I get a
connection error. Its like the connection to the database is lost..
Does anyone have any ideas of what may cause this?
Thanks!
Gunnar
|
|
| Back to top |
|
 |
Jon Lennart Aasenden Guest
|
Posted: Sun Nov 20, 2005 1:02 am Post subject: Re: Websnap + ADO |
|
|
Hei
Constant connections to databases are resource expensive.
Like other connections, they tend to time out.
Simply test the connection before using it in your procedures.
I dont use ADO (mysql is my favorite) so i dont know how you should do this,
but i believe you can just check the "active" or "connected" property.
Start all your request handling code with somthing like:
if not dbCon.Connected then
Begin
if not ReEstablishConnection then
Begin
Response.SendRedirect('dberror.html');
Exit;
end;
end;
Alternatively, check out coreLab's excellent components.
No dependencies and very fast.
Jon Lennart Aasenden
"Gunnar Liknes" <gliknesATglobalDASHsatcomDOTcom> wrote
| Quote: | Hi,
I have made a small Websnap ISAPI app that has a webdatamodule with
an ADOconnection and a webpage with a ADOStoredproc which uses
the connection in the datamodule.
Everything works fine to start with, however after some hours I get a
connection error. Its like the connection to the database is lost..
Does anyone have any ideas of what may cause this?
Thanks!
Gunnar
|
|
|
| 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
|
|