Re: What's the meaning of mysqli.rollback_on_cached_plink?

From: Date: Tue, 24 Apr 2018 22:05:41 +0000
Subject: Re: What's the meaning of mysqli.rollback_on_cached_plink?
References: 1 2 3  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969386934@lists.php.net to get a copy of this message
On 24.04.2018 at 18:57, Johannes Schlüter wrote: > Kalle thanks for CCing, I'm indeed not on the docs list. Thanks for CCing Johannes, Kalle! > > http://git.php.net/?p=php-src.git;a=blob;f=ext/mysqli/mysqli_api.c;h=2b > cbe2846ebe495e00c398bfa5786e6f1741749b;hb=HEAD#l694 > > is the relevant code. > > So when the connection is "closed" (be it explicetily by using > mysqli_close() or implicitly by scope/scrpt end) and you are using > persitent connections the connection is put back in the pool of > persistent connections available. > > If this setting is set also a rollback is initiated to rollback all > transactions.  > > Interestingly mysqlnd also does a "change_user" call when taking > connections out of the persistent connection pool which, among other > things, will also does a rollback of outstanding transactions. > > In effect I believe the only effect is to decide /when/ the rollback > happens - at "close" time or when taking the connection out of the pool > for a new connections. Thanks, Johannes! However, it seems to me that the connection is *not* put back into the pool, if rollback_on_cached_plink is true; instead the persistent connection is actually closed (if the rollback succeeded). -- Christoph M. Becker

« previous php.doc (#969386934) next »