Skip to Content.
Sympa Menu

freetds - Re: AW: [freetds] connect problem to mssql 7.0

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Daniel Fazekas <fdsubs AT axelero.hu>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: AW: [freetds] connect problem to mssql 7.0
  • Date: Mon, 15 Dec 2003 08:20:18 +0100


On Dec 10, 2003, at 19:25, roland bole wrote:

Ok,
this is the testscript i use.
<?php
$sql_host="xxx.xxx.xxx.xxx:1433";

I just noticed this line in your script.
Are you really specifying the host in a dotted IP address : port way?

If yes, you are most probably ignoring whatever you set for the server in freetds.conf, which is rarely desirable.

For example, if your freetds.conf is as follows:

[global]
dump file = /tmp/tdsdump.log

[testserver]
host = example.com
port = 1433
tds version = 7.0
client charset = WINDOWS-1252
text size = 65536


Then you would set $sql_host to "testserver"

You should do this even if the compile-time defaults or the [global] settings are sufficient for your server, as this is an easy way to assure that FreeTDS can read and process your freetds.conf file properly. If it can't, you won't even be able to connect.


Also, now that you got tsql working, did you actually test what Freddy was asking you to do originally, which was:
- have you tried to connect with tsql, waiting an hour and issuing some
sql commands?

That is, connect via tsql, execute a query, wait long enough to cause your problem (with tsql kept running), then try your query from it once more.


I'm trying to reproduce your problem here, so far without luck, so I'd welcome if you answered a few more questions:

A)
How lively is that server you are using? Is anyone else besides you accessing that Apache server while you are experimenting? Check your apache access_log to make sure it doesn't have anything to do with someone else pulling other scripts from the server meanwhile.

B)
Confirm that by now you have tried a recent snapshot of FreeTDS 0.62, and if so, what's it dated? It's my understanding that Freddy fixed for you a possible infinite loop recently; this could change your error from an execution timeout to something else. Or was Freddy just thinking out loud and not actually committing a change? :)

C)
Please check if the following steps are enough to reproduce your problem *all the time, without exception* (if not always, then what's the approximate likelihood of a failure):

1. Restart Apache.
2. You open your script via a web browser. All's fine.
3. Reload the page and it still works fine.
4. You wait 15 minutes (or whatever amount of time it needs to fail). Nobody, including you, is accessing the web server during this time.
5. Reload the page and now you get a timeout in mssql_select_db

D)
Is there some reason for using mssql_pconnect() instead of mssql_connect? The non-persistent connections might prove to be more reliable - actually they always are in our experience, regardless of what kind of database is in use (mysql included).

Even if you have a good reason for using pconnect, can't you just change it to mssql_connect() for a test and see if it worked?

E)
Please try to change the query in your test script to something any of us could test, lacking your specific database. For example "SELECT @@VERSION"

Confirm that your problem still exists with a simplified query such as this.

F)
Can you see anything suspicious in your apache error_log file?

--
fds





Archive powered by MHonArc 2.6.24.

Top of Page