Skip to content

Commit 0620eab

Browse files
committed
Fixing Oracle connection reset issues
1 parent d60e358 commit 0620eab

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tests/ConnectionFactory.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Doctrine\DBAL\Connection;
88
use Doctrine\DBAL\DriverManager;
99
use Doctrine\DBAL\Event\Listeners\OracleSessionInit;
10-
use function strtoupper;
1110

1211
class ConnectionFactory
1312
{
@@ -33,7 +32,7 @@ public static function resetDatabase(
3332

3433
// When dropAndCreateDatabase is run several times, Oracle can have some issues releasing the TDBM user.
3534
// Let's forcefully delete the connection!
36-
$adminConn->exec("select 'alter system kill session ''' || sid || ',' || serial# || ''';' from v\$session where username = '".strtoupper($dbName)."'");
35+
//$adminConn->exec("select 'alter system kill session ''' || sid || ',' || serial# || ''';' from v\$session where username = '".strtoupper($dbName)."'");
3736

3837
$adminConn->getSchemaManager()->dropAndCreateDatabase($dbName);
3938

tests/TDBMAbstractServiceTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ public static function setUpBeforeClass(): void
8989
$GLOBALS['db_name'] ?? null
9090
);
9191

92+
self::$dbConnection = $dbConnection;
93+
9294
self::initSchema($dbConnection);
9395
}
9496

@@ -415,6 +417,7 @@ private static function initSchema(Connection $connection): void
415417
$sqlStmts = $toSchema->getMigrateFromSql($fromSchema, $connection->getDatabasePlatform());
416418

417419
foreach ($sqlStmts as $sqlStmt) {
420+
//echo $sqlStmt."\n";
418421
$connection->exec($sqlStmt);
419422
}
420423

0 commit comments

Comments
 (0)