Home » Php » php – Transactions in wordpress database

php – Transactions in wordpress database

Posted by: admin July 12, 2020 Leave a comment

Questions:

WordPress is using MyISAM storage engine. MyISAM does not support transactions.

How wordpress is maintaining transactions?

I mean if wordpress is having two database write operations, how does it ensure atomicity?

How to&Answers:

Well, as far as I can tell, it doesn’t! The only reason there are not much problems with this is, that most write operations are done with a single insert or update (adding a comment, creating a new post…).

In general, most web applications I have seen so far, don’t bother too much with transactions, atomicity or even referential integrity, which is quite sad. On the one hand it is sad that so many applications just rely on pure luck that nothing bad happens and on the other hand it might lead to the impression that all these techniques aren’t that important when it comes to database stuff.

Answer:

I would think the transaction would assure atomic correctness at the previous layer of abstraction. When a transaction is occurring it default locks what it is writing. I’m not sure though.