freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "Péter András Felvégi" <petschy AT gmail.com>
- To: freetds AT lists.ibiblio.org
- Subject: [freetds] Can't reconnect, why?
- Date: Tue, 15 May 2007 16:45:56 +0200
Hello,
the link on the support page
(http://www.freetds.org/userguide/help.html) is broken, but hopefully
I can provide the necessary information anyway.
Scenario: I connect to an mssql server successfully. Then, after some
time the connection breaks because of the ISP: read/write errors
(20004/20006). I detect this event, disconnect, then try to reconnect.
The reconnect always fails, no matter how long I try. If I kill the
process, and start my app again, the connect succeeds immediately. I
don't use connection pooling, so I'm a bit confused here. Is there
some internal pooling in the tds lib? Otherwise, the reconnect should
succeed in the same process, right?
I connect like this:
Connect(...)
{
Disconnect();
LOGINREC* loginrec = dblogin();
DBSETLPWD(loginrec, pass_);
DBSETLUSER(loginrec, user_);
DBSETLAPP(loginrec, app_);
DBPROCESS* proc = dbopen(loginrec, const_cast<char*>(server_));
dbloginfree(loginrec);
if (!proc) {
// error
}
// OK ...
}
Disconnect()
{
if (m_connection) {
dbclose(m_connection);
m_connection = 0;
}
}
When the query fails with read/write error, I call Reconnect() which
just calls Connect() in a loop and sleeps a bit between the retries.
I'm using FreeTDS v0.63, on Debian Etch.
my freetds.conf is:
[xxx]
host = xxx.hu
port = 5041
tds version = 8.0
client charset = UTF-8
What's the catch here?
Regards, Peter
-
[freetds] Can't reconnect, why?,
Péter András Felvégi, 05/15/2007
- Re: [freetds] Can't reconnect, why?, James K. Lowden, 05/15/2007
- <Possible follow-up(s)>
-
Re: [freetds] Can't reconnect, why?,
Péter András Felvégi, 05/17/2007
- Re: [freetds] Can't reconnect, why?, ZIGLIO, Frediano, VF-IT, 05/17/2007
Archive powered by MHonArc 2.6.24.