Maintaining an open database connection?
Posted: Tue Mar 09, 2004 12:33 pm
Hello,
We have a proprietary database which we can connect to through a C-callable dynamic load library. Opening a connection to this database returns a small array variable (four integers), i.e. a database handle, which we can use to manage the connection.
We want to open one of these database connections via a PHP-driven web-page, interact with the database handle in a series of operations, and then exit.
In order to do this we have wrapped a mod_php dynamically-loadable module around the database library, giving us the following cascade:
Proprietary database shared-object library
PHP dynamically-loadable wrapper
mod_php4
apache
PHP scripts referencing the database handle
The question is, what do we need to do to make sure that during a single set of user interactions with this database, modifications and requests to the database four-integer handle are always interacting with the same instance of the proprietary database-connection library?
This must have something to do with PHP sessions and/or persistent connections but other than that we're lost.
Thanks!
We have a proprietary database which we can connect to through a C-callable dynamic load library. Opening a connection to this database returns a small array variable (four integers), i.e. a database handle, which we can use to manage the connection.
We want to open one of these database connections via a PHP-driven web-page, interact with the database handle in a series of operations, and then exit.
In order to do this we have wrapped a mod_php dynamically-loadable module around the database library, giving us the following cascade:
Proprietary database shared-object library
PHP dynamically-loadable wrapper
mod_php4
apache
PHP scripts referencing the database handle
The question is, what do we need to do to make sure that during a single set of user interactions with this database, modifications and requests to the database four-integer handle are always interacting with the same instance of the proprietary database-connection library?
This must have something to do with PHP sessions and/or persistent connections but other than that we're lost.
Thanks!