1
0
mirror of synced 2024-12-13 22:56:04 +03:00
doctrine2/manual/docs/Database operations - Nested transactions.php

19 lines
314 B
PHP
Raw Normal View History

<code type="php">
2006-07-24 01:08:06 +04:00
try {
$conn->beginTransaction();
2006-07-24 01:08:06 +04:00
$user->save();
$conn->beginTransaction();
2006-07-24 01:08:06 +04:00
$group->save();
$email->save();
$conn->commit();
2006-07-24 01:08:06 +04:00
$conn->commit();
2006-07-24 01:08:06 +04:00
} catch(Exception $e) {
$conn->rollback();
2006-07-24 01:08:06 +04:00
}
</code>