-
-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transaction and their propagation management #1274
Comments
This is not something that can be added in DoctrineBundle itself, which is only about configuring the DBAL and ORM projects in a Symfony context. We cannot add this concept without support in the ORM. |
DBAL 2.11 automatically handles lost connections doctrine/dbal#4119, what other issues with long lived demons you have? Anyways, as @stof pointed out, this would need to be added to dbal/orm. |
@ostrolucky no, that's not what I was talking about
@stof I suspect that this is not the level of doctrine. This is only concept how we should use Document Manager (more precisely, several DM's). Сan anyone tell me which component should be responsible for this? |
It's not clear what are you trying to do. You can use multiple entity managers without issues already. And spring documentation is not very clear either, you should do the work and explain what are you asking here better. |
@ostrolucky the repositories are injected by higher layer and it do not offer a choice which DM should be used.
Doctrine made in the likeness JPA, but without transaction propagation management ability. Are you used original JPA? |
Keyword here is default. You specify your entity managers in your doctrine.yaml config and this configuration includes which entity is managed by which entity manager.
No, I didn't use it and I don't know what is transaction propagation management. |
@ostrolucky |
Since we are not smart enough to understand your requirements and you are not willing to explain them better, feel free to open the PR with your changes. In the meanwhile, I'm indeed closing this issue. |
The Symfony now uses one global entiry manager (or Document Manager for DoctrineODM, the essence is the same).
It leads to the troubles when we deal with long-lived demons (console applications). For excample we may want to clear UoW in some service, but this will affect other services. The application have one global registry and that's not good.
In the Spring Framework this problem is solved by using sessions and transaction propagation levels:
simple article https://www.baeldung.com/spring-transactional-propagation-isolation
full official documentation https://docs.spring.io/spring-framework/docs/4.2.x/spring-framework-reference/html/transaction.html#tx-propagation
It is worth noting that the Spring uses own individual Document Manager for each isolated transaction (session).
Have you considered adding a similar mechanism to the Symfony?
It would be very cool to be able to manage transactions and their propagation level through annotations.
PS: I doubted where I should place this proposal: here or in doctrine repo. I think that it is over repo level.
The text was updated successfully, but these errors were encountered: