I have an app built on CakePHP. Have 4 environments for app - local, testing, acceptance and production. Suddenly on only one of them (of course it's production) I started getting problems with transactions. The error I get is:
There is already an active transaction
#0 /.../lib/Cake/Model/Datasource/DboSource.php(2294): PDO->beginTransaction()
#1 /.../lib/Cake/Model/Model.php(1749): DboSource->begin()
#2 /.../app/Model/AppModel.php(499): Model->save(Array, true, Array)
.....
MySQL versions and settings seem to be identically on all environments, maybe the only difference it's max_connections. Also recently we didn't have CakePHP framework update, and app code is the same on environments.
Debug shows me that there are 2 BEGIN transactions call in a row during script execution, but as official MySQL doc says:
Transactions cannot be nested. This is a consequence of the implicit commit performed for any current transaction when you issue a START TRANSACTION statement or one of its synonyms.
so I suppose it should not be a problem, plus on all environments there are the same 2 BEGIN, and everything just works fine there.
Something tells me that if everything is ok on 3 of 4 environments, the reason is in environment, but I have no idea what it can be, and google doesn't say to much about.
What can be the reason, where I should look for?