-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incorrect
transactional()
handling when DB auto-rolled back the…
… transaction Let's get rid of There's no active transaction exception which occurs e.g. when using deferred constraints so the violation is checked at the end of the transaction and not during it. - Do not rollback only on exceptions where we know the transaction is no longer active - Introduce TransactionRolledBack exception - Transform Oracle's "transaction rolled back" exception and use the underlying one that DBAL supports
- Loading branch information
Showing
7 changed files
with
711 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Doctrine\DBAL\Exception; | ||
|
||
use Doctrine\DBAL\Driver\Exception as TheDriverException; | ||
use Doctrine\DBAL\Query; | ||
|
||
/** @psalm-immutable */ | ||
class TransactionRolledBack extends DriverException | ||
{ | ||
private DriverException $why; | ||
|
||
public function __construct(DriverException $why, TheDriverException $driverException, ?Query $query) | ||
{ | ||
parent::__construct($driverException, $query); | ||
|
||
$this->why = $why; | ||
} | ||
|
||
public function why(): DriverException | ||
{ | ||
return $this->why; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.