1
0
mirror of synced 2025-01-18 22:41:43 +03:00
doctrine2/manual/codes/Database operations - Nested transactions.php

18 lines
296 B
PHP
Raw Normal View History

2006-07-23 21:08:06 +00:00
<?php
try {
$conn->beginTransaction();
2006-07-23 21:08:06 +00:00
$user->save();
$conn->beginTransaction();
2006-07-23 21:08:06 +00:00
$group->save();
$email->save();
$conn->commit();
2006-07-23 21:08:06 +00:00
$conn->commit();
2006-07-23 21:08:06 +00:00
} catch(Exception $e) {
$conn->rollback();
2006-07-23 21:08:06 +00:00
}
?>