php-lock / lock

Lock library to provide serialized execution of PHP code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reconsider requiring ATTR_AUTOCOMMIT to be disabled (on MySQL)

rubenvandeven opened this issue · comments

commented

Hi,

I just ran into the problem that the TransactionalMutex requires a PDO connection with ATTR_AUTOCOMMIT disabled.
As I see the code and consider the MySQL documentation on AUTOCOMMIT, it seems autocommit is already disabled when $this->pdo->beginTransaction(); is ran (this state lasts until the commit()).
Could you confirm whether my thought is correct? If so, would it be possible to skip the AUTOCOMMIT check -- at least for a MySQL PDO connection?

Thank you!

Thank you for this information. I wasn't aware of that behaviour. I will omit that check for MySQL. However I cannot do so in general as ATTR_AUTOCOMMIT has an effect on other DBS.