On 26.03.2011, at 10:43, Lukas Kahwe Smith wrote:

> So when a transaction does fail the only solution is to effectively make a 
> totally new EntityManager according to Benjamin.
> 
> Now if you use Container injecting this is less of a problem (though still  
> problem, more below). If you don't, you basically need to not only make the 
> new instance, but you also need to magically find out all the places that 
> follow the failed transaction (DB logger, rendered form with DB filled choice 
> fields.
> 
> Now if you do inject the Container everywhere and never assign it to a class 
> property all you have to do is reset the service. However this is less 
> trivial than you might think because of service aliasing:
> 
> // reset the EM and all aias
> $container->set('doctrine.orm.entity_manager', null);
> $container->set('doctrine.orm.default_entity_manager', null);
> // get a fresh EM
> $em = $this->container->get('doctrine.orm.entity_manager');


I should add when not injecting the Container I obviously also shouldn't need 
to know the name of the service, which makes the above code even harder.

regards,
Lukas Kahwe Smith
[email protected]



-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to