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!
Maintaining an open database connection?
Moderator: General Moderators
Try to pm Volka ( profile.php?mode=viewprofile&u=185 ). It's quite a few people able to help you here, and I believe he's one of them.
...and I'm taking it back to this thread since I skate on thin ice 
Apparently you want something like mysql_pconnect, but with one extension that is explicitly pointed out not to be supported, see: http://php.net/manual/en/features.persistent-connections.php. To my knowledge there is (atm) no reliable way to circumvent this restriction for reasons explained in this document as long as http is the transport layer. This is also true for your module.
Although http/1.1 defines a way to keep a connection between client and server alive between two requests, that -in theory- makes it possible to bind resources to a connection throughout a session, this has no practical meaning for php.
Do you want to implement/use some kind of transaction mechanism and therefor need not to close the database connection until the transaction is either comitted or aborted?
Apparently you want something like mysql_pconnect, but with one extension that is explicitly pointed out not to be supported, see: http://php.net/manual/en/features.persistent-connections.php. To my knowledge there is (atm) no reliable way to circumvent this restriction for reasons explained in this document as long as http is the transport layer. This is also true for your module.
Although http/1.1 defines a way to keep a connection between client and server alive between two requests, that -in theory- makes it possible to bind resources to a connection throughout a session, this has no practical meaning for php.
Do you want to implement/use some kind of transaction mechanism and therefor need not to close the database connection until the transaction is either comitted or aborted?
Do you want to implement/use some kind of transaction mechanism and therefor need not to close the database connection until the transaction is either comitted or aborted?
Yes. We want to conduct multiple transactions on the same connection
without closing it. Thanks for the feedback. Any ideas would be appreciated...