Skip to Content.
Sympa Menu

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

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "roland bole" <roland.bole AT gmx.at>
  • To: "'FreeTDS Development Group'" <freetds AT lists.ibiblio.org>
  • Subject: AW: AW: [freetds] connect problem to mssql 7.0
  • Date: Tue, 16 Dec 2003 08:06:39 +0100

Thanks for your help,

i will answer your questions soon , organize and do what you said.

> > 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 have completely right, I will change this.
Do you think this could be also a reason for the failed connection after a
while.

> 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.

I have to go into a testphase, I have one user how is testing, because my
company will work with our application.

> 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? :)

I have to change this also, now I use FreeTDS 0.61.

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

Only this errors from an invalid URI, but the client is the Sql Server

[Mon Dec 15 13:43:24 2003] [error] [client 192.168.1.14] Invalid URI in
request GET /../../images/speichern.gif HTTP/1.0
[Mon Dec 15 13:43:24 2003] [error] [client 192.168.1.14] Invalid URI in
request GET /../../images/speichern.gif HTTP/1.0

> 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?

Mssql_pconnect, we have some queries where we get information about customer
info, e.g. for customer search, or customer offerts, there for I think
mssql_pconnect is the right way.

I will try mssql_connect.

Roland


-----Ursprüngliche Nachricht-----
Von: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] Im Auftrag von Daniel Fazekas
Gesendet: Montag, 15. Dezember 2003 08:20
An: FreeTDS Development Group
Betreff: Re: AW: [freetds] connect problem to mssql 7.0


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

_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds






Archive powered by MHonArc 2.6.24.

Top of Page