-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.0.40: yii\web\HttpException: PDO::inTransaction(): SQLSTATE[00000]: No error: PDO constructor was not called #18471
Comments
Thanks for posting in our issue tracker.
Thanks! This is an automated comment, triggered by adding the label |
When does the issue occur? What do you see? What was the expected result? I am going out on a limb here, but maybe the fix for "Bug #18406" has something to do with this? |
What DB engine are you using here? |
Good question, apologies for not stating that: sfedosimov/yii2-oci8pdo v1.0.0.0 Emulation of the PDO driver by means of OCI8 |
I cannot say this for 100% sure but this might be because of that package. I can see that https://github.com/sfedosimov/yii2-oci8pdo/blob/master/Oci8PDO.php constructor's is not calling parent's constructor. @sfedosimov might be better than me to judge that |
But why does this happen only after updating yii to version 2.0.40? Up to now it has been working flawless. |
Fix in #18406 revealed it. |
So as long as I am using an oracle database I am stuck at version 2.0.39.3. Since sfedosimov/yii2-oci8pdo does not seem to be actively maintained. I inherited this project but sticking with 2.0.39.3 seems a lot less work than switching databases or database connectors. I just don't understand why the 'regular' database transactions work, just not when used in conjunction with kartik\editable\Editable. Maybe at some point I can figure out a way around this, for now I will simply not upgrade. |
Thanks for the quick responses by the way, it is greatly appreciated. |
Cheers. My guess would be that there is multilevel transaction involved here. Please check if this is the case as well when not using Editable. |
Right. Did some more digging, added a ton of debugging stuff and you know what? The Oci8PDO.php does have a function isTransaction, but not an inTransaction (I probably missed this one letter difference a couple of 100 times during debugging). So, adding the inTransaction funtion (returning $this->_isTransaction) works wonders. Everything seems to work fine with this added function. Does that make any sense? |
Apparently I am not the only one who figured this out: |
Hmm, yes. Without this it tries to use parent's method and this probably causes the problem. Thanks for all the digging. I'm closing this since it's the 3rd party package that must be fixed. |
What steps will reproduce the problem?
Update yii2 to 2.0.40 (from 2.39.3)
What is the expected result?
No errors
What do you get instead?
[error][yii\web\HttpException:500] yii\web\HttpException: PDO::inTransaction(): SQLSTATE[00000]: No error: PDO constructor was not called in controllers/DocumentController.php:614
Stack trace:
#0 [internal function]: app\controllers\DocumentController->actionUpdateKpiValuesCompany()
#1 vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#2 vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams(Array)
#3 vendor/yiisoft/yii2/base/Module.php(534): yii\base\Controller->runAction('update-kpi-valu...', Array)
#4 vendor/yiisoft/yii2/web/Application.php(104): yii\base\Module->runAction('document/update...', Array)
#5 vendor/yiisoft/yii2/base/Application.php(392): yii\web\Application->handleRequest(Object(yii\web\Request))
#6 web/index.php(11): yii\base\Application->run()
Additional info
The text was updated successfully, but these errors were encountered: