Hi Matthieu, I accidentally foundthe following paragraph from Doctrine API Docs that makes me think that ORM uses slave connections kind of randomly:
"This connection is limited to slave operations using the Connection#executeQuery operation only, because it wouldn't be compatible with the ORM or SchemaManager code otherwise. Both use all the other operations in a context where writes could happen to a slave, which makes this restricted approach necessary." (http://www.doctrine-project.org/api/dbal/2.4/class-Doctrine.DBAL.Connections.MasterSlaveConnection.html) I haven't explored further how this works in practice, but definitely would like to see more granular control when queries may happen against slave. Something like slaveOk in Mongo world... ;) Ville Well I understand, but this documentation is only about DBAL, and that’s my > problem. > > I have no idea if the ORM (which uses DBAL) will fetch entities using > « executeQuery » outside of transactions. I don’t know what methods the ORM > uses on the DBAL connection. > > I am afraid by feeding the ORM this special DBAL connections all queries > will go to the master. I just want to make sure that this DBAL features is > compatible with the ORM: > > - fetching entities go to slaves (i.e. it uses executeQuery without > transactions) > - anything else go to master > > -- 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/d/optout.
