Monday 05 May 2008 12:00:37 pm
For a number of eZ methods and functions, you have this warning: NOTE: Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.
How does this apply to methods that have a transaction defined in them <b>and</b> have this transaction note? Example: <i>kernel/classes/ezcontentobjecttreenode.php</i> static function removeSubtrees( $deleteIDArray, $moveToTrash = true, $infoOnly = false )
{
....
$db = eZDB::instance();
$db->begin();
foreach ( $deleteIDArray as $deleteID )
{
....
}
$db->commit();
...
}
Then imagine this:
$db = eZDB::instance();
$db->begin();
eZContentObjectTreeNode::removeSubtrees( ... );
...
$db->commit();
Would that somehow nest transactions (which would be the first I've heard of)? Or does it trick the inner transaction to be continued (and the inner commit to be skipped)? Or does the inner transaction simply end the first transaction (just as if a commit was queried) as soon as the inner begin is triggered?
--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu
|