\Zend\Db\Adapter\Driver\Pdo\Connection::rollback error
sorkl opened this issue · 3 comments
sorkl commented
zend-db/src/Adapter/Driver/Pdo/Connection.php
Line 345 in 4c68f2c
the function code like bellow maybe more better
public function rollback()
{
if (!$this->isConnected()) {
throw new Exception\RuntimeException('Must be connected before you can rollback');
}
if (!$this->inTransaction()) {
throw new Exception\RuntimeException('Must call beginTransaction() before you can rollback');
}
if (0 === $this->nestedTransactionsCount) {
$this->resource->rollBack();
$this->nestedTransactionsCount = 0;
}
return $this;
}
michalbundyra commented
@sorkl Would you like submit PR with the change and unit test? Thanks!
usuyukiso commented
I have similar issue
Must call beginTransaction() before you can rollback In Zend\Db\Adapter\Driver\Pdo\Connection.php line 353.
Even though it was transaction. Also checked that it works with php 5.6, but fails with php7.2
I use libraries:
zendframework/zend-db 2.10.0
zendframework/zend-stdlib 3.2.1
michalbundyra commented
See: #390. Closing as "won't fix".