begin(), commit() & rollback() calls are forbidden in transaction() callback, but the other way should be forbidden also, or supported - rollback() currently does not work silently.
relates to: #387
example:
$dibi = new Dibi\Connection([
'driver' => 'postgre',
// ...
]);
echo "<h2>Before</h2>\n";
$dibi->query('SELECT * FROM [products]')->dump();
$dibi->begin();
$dibi->transaction(function ($transaction) use ($dibi) {
$dibi->query('INSERT INTO [products]', [
'title' => 'Test product',
]);
});
$dibi->rollback();
echo "<h2>After rollback</h2>\n";
$dibi->query('SELECT * FROM [products]')->dump();
// -> rollback did not work