When I call beginTransaction(), must all executions follow in the same scope?
<p>Example:</p>

<pre><code>// assume PDO instance here: $dbh

function beginTransaction() {
   global $dbh;
   $dbh-&gt;beginTransaction();
}

beginTransaction(); // no typo! called the function above!

$dbh-&gt;exec($sql1); // assume $sql1 is there
$dbh-&gt;exec($sql2); // assume $sql2 is there

$dbh-&gt;commit();
</code></pre>

<p>What I try to ask: Must a transaction be started and commited inside ONE scope, or can I span a transaction over a wide range of function and method calls? For me it would be logical that the called object doesn't care about the caller. But in Objective-C / Cocoa for example, a UIView animation block IS scope-aware! So I'm confused like a bird in a plane.</p>
