I am still reading wiki to educate myself. As about the second code here:
https://doctrine-orm.readthedocs.org/en/latest/reference/transactions-and-concurrency.html?highlight=explicit#approach-2-explicitly

I am confused, it means after this code:

$em->transactional(function($em) {
    //... do some work
    $user = new User;
    $user->setName('George');
    $em->persist($user);
});

I still should have something like below to flush the entity that persists
above and rollback it if an exception occurs?

try {
    $em->flush();
    $em->getConnection()->commit();
} catch (Exception $e) {
    $em->getConnection()->rollback();
    throw $e;
}

Please clarify.

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to