Hey Matthieu! I can't really tell much more than what is already described in that specific class: https://github.com/doctrine/dbal/blob/149f18001a459c22e1f2a87903e455eb89c1b4de/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php#L37-L43
Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On 1 March 2014 01:47, Matthieu Napoli <[email protected]> wrote: > What you said is about « update/insert/delete » queries right? > I want to know about « select » queries and make sure they end up on the > slaves. > > Matthieu > > On 1 mars 2014 01:43:39, Marco Pivetta <[email protected]> wrote: > ------------------------------ > Hey Matthieu, > > Usually, the ORM runs update/delete/insert queries during > `EntityManager#flush()`, and that starts and commits transaction internally. > > That should be enough for you :) > > Marco Pivetta > > http://twitter.com/Ocramius > > http://ocramius.github.com/ > > > On 1 March 2014 01:13, Matthieu Napoli <[email protected]> wrote: > >> Hi Marco, >> >> Yes, I should have been more explicit, and on top of that I mixed things >> up. My problem is that nowhere it is said that the ORM works as expected >> with this connection. The MasterSlaveConnection will only execute >> « executeQuery » to a slave (the rest will go to master), but is that >> compatible with the queries generated by the ORM? >> In other terms, when the EntityManager fetches entities, does it >> correctly uses « executeQuery » out of transactions (which will be then run >> against the slave)? >> >> Thanks >> Matthieu >> >> On 28 févr. 2014 21:07:40, Marco Pivetta <[email protected]> wrote: >> ------------------------------ >> Hi Mattieu, >> >> Did you check the MasterSlaveConnection? >> https://github.com/doctrine/dbal/blob/149f18001a459c22e1f2a87903e455eb89c1b4de/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php >> >> Marco Pivetta >> >> http://twitter.com/Ocramius >> >> http://ocramius.github.com/ >> >> >> On 27 February 2014 21:55, Matthieu Napoli <[email protected]> wrote: >> >>> Hi there, >>> >>> I have read how to create several DBAL connections for handling slaves >>> and read/writes separation (for example in Symfony 2). However I see >>> nowhere a mention that it indeeds works with the ORM and the EntityManager. >>> >>> Is there a way to have the EntityManager perform read queries on a >>> connection, and write queries/transactions on another? >>> >>> Thanks >>> Matthieu >>> -- >>> 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. >>> >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "doctrine-user" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/doctrine-user/yfhc_3uAaSg/unsubscribe. >> To unsubscribe from this group and all its topics, 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. >> > > -- > You received this message because you are subscribed to a topic in the > Google Groups "doctrine-user" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/doctrine-user/yfhc_3uAaSg/unsubscribe. > To unsubscribe from this group and all its topics, 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. > > -- > 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. > -- 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.
