Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-491

Oracle platform should not support dropping database

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.3.3
    • Fix Version/s: None
    • Component/s: Platforms
    • Security Level: All
    • Labels:
      None
    • Environment:
      RHEL w/Oracle

      Description

      It appears that attempting to run the Doctrine ORM test suite against an Oracle database causes the following exception:

      [root@raymond-kolbe-1 orm]# /usr/local/zend/bin/phpunit -c oracle.xml
      PHPUnit 3.7.19 by Sebastian Bergmann.

      Configuration read from /home/rkolbe/sites/trainingv2/vendor/doctrine/orm/oracle.xml

      ......................SSSSSS...........................E

      Time: 1 second, Memory: 68.75Mb

      There was 1 error:

      1) Doctrine\Tests\ORM\Functional\AdvancedAssociationTest::testIssue
      Doctrine\DBAL\DBALException: An exception occurred while executing 'DROP USER rkolbe CASCADE':

      ORA-01940: cannot drop a user that is currently connected

      /home/rkolbe/sites/trainingv2/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:47
      /home/rkolbe/sites/trainingv2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php:189
      /home/rkolbe/sites/trainingv2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php:112
      /home/rkolbe/sites/trainingv2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:791
      /home/rkolbe/sites/trainingv2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php:816
      /home/rkolbe/sites/trainingv2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php:306
      /home/rkolbe/sites/trainingv2/vendor/doctrine/orm/tests/Doctrine/Tests/TestUtil.php:66
      /home/rkolbe/sites/trainingv2/vendor/doctrine/orm/tests/Doctrine/Tests/OrmFunctionalTestCase.php:315
      /home/rkolbe/sites/trainingv2/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php:17

      Caused by
      Doctrine\DBAL\Driver\OCI8\OCI8Exception: ORA-01940: cannot drop a user that is currently connected

      /home/rkolbe/sites/trainingv2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php:28
      /home/rkolbe/sites/trainingv2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php:189
      /home/rkolbe/sites/trainingv2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php:112
      /home/rkolbe/sites/trainingv2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:791
      /home/rkolbe/sites/trainingv2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php:816
      /home/rkolbe/sites/trainingv2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php:306
      /home/rkolbe/sites/trainingv2/vendor/doctrine/orm/tests/Doctrine/Tests/TestUtil.php:66
      /home/rkolbe/sites/trainingv2/vendor/doctrine/orm/tests/Doctrine/Tests/OrmFunctionalTestCase.php:315
      /home/rkolbe/sites/trainingv2/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php:17

      FAILURES!
      Tests: 56, Assertions: 98, Errors: 1, Skipped: 6.

      After investigating, I asked myself "Should Doctrine support dropping a "database"?" It should not, and here is why.

      1) Oracle does not consider a "database" the same way MySQL and other vendors do. A "schema" is the database and this is the "user". Dropping a "database" drops the user. How would we recreate the database for testing purposes (read: DBAL drops and recreates the database)?

      2) Oracle platform in DBAL does not support creating a database. Is this something we wish to support? I'm not sure how we would recreate a schema, since creating a schema is the same as creating a user. This is something we don't support on any platform. Also note, the return value of supportsCreateDropDatabase() is misleading as it says Oracle does support this feature.

      Although this issue originated in Doctrine ORM, the root cause is the Oracle platform implementation in DBAL. I propose we remove support for dropping "databases" in Oracle since there is no way to create them.

        Activity

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Raymond Kolbe
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: