George Schlossnagle wrote:


On May 22, 2004, at 9:12 PM, Alan Knowles wrote:

Just a thought - feel free to ignore...
In dataobjects rather than implement extra methods for transactions, I just hooked into query
..
eg. $do->query('BEGIN') - turned off autocommit, and ran begin.
$do->query('ROLLBACK') or $do->('COMMIT'); - ranit , then turned autocommit back on


It seemed far more sensible than fattening up the API.


The problem is that those have different syntaxes in different rdbms systems.

thats why it hooks into the query (or exec method, and re-writes it).. In dataobjects it something like this.
function query($str) {
if ($str == 'BEGIN') {
$db->begin(); ... this deals with the different syntaxes..
return;
}
$db->query($str);
}


Regards
Alan



George


-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to