Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Directly use the driverConnection executeUpdate method#37358
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Directly use the driverConnection executeUpdate method#37358
Uh oh!
There was an error while loading.Please reload this page.
Conversation
derrabus left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Is it possible to write a test for your scenario?
TristanPouliquen commentedJun 25, 2020
@derrabus Hey, I tried but I don't know if I can easily simulate a master-slave connection with read-only slaves easily with the CI. If you have any clue on how to proceed, I'd be happy to do it! |
derrabus commentedJun 25, 2020
🤔 I don't have a good idea either. |
fabpot commentedJun 25, 2020
Thank you@TristanPouliquen. |
christickner commentedJun 25, 2020
Thanks@TristanPouliquen |
Uh oh!
There was an error while loading.Please reload this page.
executeUpdate & executeQuery methods do not throw a TableNotFoundException. No need for the try/catch as it is done for executeQuery
As explained in#37355, when doing a write operation, one should avoid using the
executeQuerymethod of a Connection, as Doctrine's MasterSlaveConnection can pick a slave instance (usually read-only) for these operations.