What are the disadvantages of using persistent connection in PDO

前端 未结 8 1199
囚心锁ツ
囚心锁ツ 2020-11-22 14:41

In PDO, a connection can be made persistent using the PDO::ATTR_PERSISTENT attribute. According to the php manual -

Persistent connectio

8条回答
  •  北海茫月
    2020-11-22 15:22

    Persistent connections should give a sizable performance boost. I disagree with the assement that you should "Avoid" persistence..

    It sounds like the complaints above are driven by someone using MyIASM tables and hacking in their own versions of transactions by grabbing table locks.. Well of course you're going to deadlock! Use PDO's beginTransaction() and move your tables over to InnoDB..

提交回复
热议问题