How wordpress is maintaining transactions?
I mean if wordpress is having two database write operations, how does it ensure atomicity?
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.
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.