Is this a bug in the Advantage database?
I am running into what seems to me to be a bug in extending the Advantage Database (I know, I know ...). I reported this as a bug but haven't heard anything so far, so I figured you guys would run it.
Working code:
for ($i = 0; $i < 100; $i++)
{
$connection = ads_connect( 'DataDirectory=\\some\path\;ServerTypes=2;RightsChecking=Off;TrimTrailingSpaces=true;CommType=TCP_IP;', '', '' );
$results = ads_do( $connection , 'SELECT TOP 1 * FROM projects');
ads_close( $connection );
}
This just repeats up to 100 times, connects to the db, executes the request and disconnects.
Broken code:
for ($i = 0; $i < 100; $i++)
{
$connection = ads_connect( 'DataDirectory=\\some\path\;ServerTypes=2;RightsChecking=Off;TrimTrailingSpaces=true;CommType=TCP_IP;', '', '' );
$results = ads_do( $connection , 'SELECT TOP 1 * FROM projects');
$results = ads_do( $connection , 'SELECT TOP 1 * FROM projects');
ads_close( $connection );
}
Pay attention to the execution of the second query? This loop fails on the 51st loop (db server limits each application to 50 concurrent connections) with error
Error 6303: Maximum Advantage The connection to the database server was exceeded.
I've tried several other things including this with no success:
for ($i = 0; $i < 100; $i++)
{
$connection = ads_connect( 'DataDirectory=\\some\path\;ServerTypes=2;RightsChecking=Off;TrimTrailingSpaces=true;CommType=TCP_IP;', '', '' );
$results = ads_do( $connection , 'SELECT TOP 1 * FROM projects');
ads_free_result( $results );
$results = ads_do( $connection , 'SELECT TOP 1 * FROM projects');
ads_free_result( $results );
ads_close( $connection );
}
This, however, DOES fixes the problem and the GENERAL questions are still successful and accurate!
for ($i = 0; $i < 100; $i++)
{
$connection = ads_connect( 'DataDirectory=\\some\path\;ServerTypes=2;RightsChecking=Off;TrimTrailingSpaces=true;CommType=TCP_IP;', '', '' );
$results = ads_do( $connection , 'SELECT TOP 1 * FROM projects');
ads_close( $connection );
$results = ads_do( $connection , 'SELECT TOP 1 * FROM projects');
ads_close( $connection );
}
This all seems very strange to me ... any ideas?
EDIT: I'm on PHP 5.2.5 and ADS 8.1
source to share
Knowledgebase has this item in error 6303 and how to increase the number of possible connections from a client, http://devzone.advantagedatabase.com/dz/content.aspx?Key=17&RefNo=981124-0621 . R&D is currently investigating this issue and is trying to resolve it in the next release of the service.
source to share