Skip to content

Commit efe7c35

Browse files
committed
fix #54193: use common sequence name to get id from Oracle
1 parent 00ba3ad commit efe7c35

File tree

1 file changed

+12
-0
lines changed
  • src/Symfony/Component/Messenger/Bridge/Doctrine/Transport

1 file changed

+12
-0
lines changed

src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,18 @@ private function executeInsert(string $sql, array $parameters = [], array $types
459459
if (!$id) {
460460
throw new TransportException('no id was returned by PostgreSQL from RETURNING clause.');
461461
}
462+
} elseif ($this->driverConnection->getDatabasePlatform() instanceof OraclePlatform) {
463+
$sequenceName = 'seq_' . $this->configuration['table_name'];
464+
465+
$this->driverConnection->executeStatement($sql, $parameters, $types);
466+
467+
$result = $this->driverConnection->fetchOne('SELECT ' . $sequenceName . '.CURRVAL FROM DUAL');
468+
469+
$id = (int) $result;
470+
471+
if (!$id) {
472+
throw new TransportException('no id was returned by Oracle from sequence: ' . $sequenceName);
473+
}
462474
} else {
463475
$this->driverConnection->executeStatement($sql, $parameters, $types);
464476

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy