Persistent connections with PHP

Posted by Admin on 24-Sep-2004 04:29

Hi all

I am connecting to a Progress 9.1C Database by ODBC using the Merant Driver. I am accessing said database using said driver from within a PHP script using a persistent connection (odbc_pconnect()). All this works very well for a certain amount of time.

The problem is as follows: I am only allowed one ODBC-connection to the database (hence the persistent connection since I don't want several people accessing an intranet page at the same time getting errors about allowed numbers of connections). The persistent connection works fine until I don't use it a certain amount of time (can't specify this exactly, suppose it to be an hour or more). Then I get an error about exceeding the maximum allowed number of connections. This seems strange to me. As far as I understand it, when calling a persistent connection in PHP, the PHP-engine checks if a connection with the same parameters already exists and if so it uses this connection instead of creating a new one. So if, after an hour or so of inactivity, the persistent connection from the last call of the script was terminated, PHP tries to create a new connection, and this fails because the old connection still seems to exist in one way or another. (btw. I hope that I articulated myself in an understandable manner so far. My english isn't the best...).

Do you see the contradiction? If no connection exists, PHP should create a new one which should work fine and not exceed the maximum number of allowed connection since there are none at that time. If however a connection exists PHP should use this one and not try to create a new one.

All Replies

Posted by Admin on 26-Sep-2004 04:02

This might be a known issue.

Install a second broker. Change the type of the old broker to 4GL only, and the new broker to SQL only.


Posted by Admin on 27-Sep-2004 11:03

I believe there is already a setup as you described it running.

This thread is closed