dbx_connect() forcing a new connection to mysql
| From: | J.T. Moore | Date: | Tue, 27 Jul 2004 13:19:36 +0000 |
| Subject: | dbx_connect() forcing a new connection to mysql | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-35471@lists.php.net to get a copy of this message | ||
Is there a way to force dbx_connect() to create a new connection to a mysql
database?
The reason I ask is that I want to be able to use transactions with mysql
Innodb tables, but from the notes in the php mysql function documentation,
it appears that if two php scripts begin a transaction over the same mysql
connection and one of the scripts rolls back a transaction, both of the
transactions will be rolled back.
The documentation notes suggest the only way to avoid this is by creating a
unique database connection for each transaction and that the 'new_link'
parameter must be used in mysql_connect, otherwise an existing connection to
the same host and database with the same username and password will be
reused.
I am using the dbx database functions because I attempting to develop a php
application that can run with mysql, mssql, or oracle as the database
without requiring seperate blocks of code for each database type. I'm not
interested in using either the adodb or pear db functions.
Thanks,
J.T.