I have begun work on the next set of features for MDB2. I just implemented a feature inspired by the popular ADODB abstraction layer. John calls it smart transactions, while I am currently planning on calling it nested transactions. However I will wait until Lorenzo has some time to look at things to see if we can fit native nested transactions in there or not. Interbase/Firedbird really shines in this department.
I have written up a little script to show the current implementation available in CVS:
<?php
$mdb2 =& MDB2::singleton($dsn);
$mdb2->setOption('debug', true);
$query = "DELETE FROM autoinc";
$result = $mdb2->exec($query);
$query = "SELECT id FROM autoinc";
$result = $mdb2->queryCol($query);
var_dump($result);
$query = "INSERT INTO autoinc (id) VALUES (?)";
$stmt = $mdb2->prepare($query);
$mdb2->beginNestedTransaction(); …
[Read more]