Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-61

Incompatible transactions in OCI8 driver with other drivers (pdo_oci, pdo_mysql, pdo_pgsql)

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-BETA4
    • Fix Version/s: 2.0.0-RC1-RC3
    • Component/s: Drivers
    • Labels:
      None
    • Environment:
      PHP Version 5.3.3-1ubuntu9, OCI8 1.4.1, Oracle 10.2.0.4.0

      Description

      When I try to insert some data, it is not saved into database.

      $connectionOptions['oci8'] = array(
          'driver' => 'oci8',
          'dbname' => 'BOOK',
          'user' => 'doctrine',
          'password' => 'doctrine',
      //    'charset' => 'AL32UTF8',
      );
      
      $em = EntityManager::create($connectionOptions['oci8'], $config, $evm);
      $conn = $em->getConnection();
      $conn->connect();
      $conn->insert('my_table', array('my_column' => 'Some value'));
      

      When I invoke the previous code on any other DBAL driver, like pdo_oci, pdo_mysql, pdo_pgsql, the row is inserted.

      That's because Oracle is transactional, and everything need to be commited. This behavior prevent's me (and I think in a feature not only me), to use 3rd party code (bundles, models, plugins...) in my applications running oracle. This behavior prevents developers to write portable code with DBAL. The solution is to make OCI8Driver commit everything after invoking oci_execute(), the same way how Doctrine_Adapter_Oracle works in Doctrine1. (https://github.com/doctrine/doctrine1/blob/master/lib/Doctrine/Adapter/Oracle.php)

        Activity

        Miloslav "adrive" Kmet created issue -
        Hide
        Benjamin Eberlei added a comment -

        Scheduled for RC1, thanks for the patch - I will apply asap.

        Show
        Benjamin Eberlei added a comment - Scheduled for RC1, thanks for the patch - I will apply asap.
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Fix Version/s 2.0.0-RC1 [ 10094 ]
        Description
        When I try to insert some data, it is not saved into database.

        {code}
        $connectionOptions['oci8'] = array(
            'driver' => 'oci8',
            'dbname' => 'BOOK',
            'user' => 'doctrine',
            'password' => 'doctrine',
        // 'charset' => 'AL32UTF8',
        );

        $em = EntityManager::create($connectionOptions['oci8'], $config, $evm);
        $conn = $em->getConnection();
        $conn->connect();
        $conn->insert('my_table', array('my_column' => 'Some value'));
        {code}

        When I invoke the previous code on any other DBAL driver, like pdo_oci, pdo_mysql, pdo_pgsql, the row is inserted.

        That's because Oracle is transactional, and everything need to be commited. This behavior prevent's me (and I think in a feature not only me), to use 3rd party code (bundles, models, plugins...) in my applications running oracle. This behavior prevents developers to write portable code with DBAL. The solution is to make OCI8Driver commit everything after invoking oci_execute(), the same way how Doctrine_Adapter_Oracle works in Doctrine1. (https://github.com/doctrine/doctrine1/blob/master/lib/Doctrine/Adapter/Oracle.php)




        When I try to insert some data, it is not saved into database.

        {code}
        $connectionOptions['oci8'] = array(
            'driver' => 'oci8',
            'dbname' => 'BOOK',
            'user' => 'doctrine',
            'password' => 'doctrine',
        // 'charset' => 'AL32UTF8',
        );

        $em = EntityManager::create($connectionOptions['oci8'], $config, $evm);
        $conn = $em->getConnection();
        $conn->connect();
        $conn->insert('my_table', array('my_column' => 'Some value'));
        {code}

        When I invoke the previous code on any other DBAL driver, like pdo_oci, pdo_mysql, pdo_pgsql, the row is inserted.

        That's because Oracle is transactional, and everything need to be commited. This behavior prevent's me (and I think in a feature not only me), to use 3rd party code (bundles, models, plugins...) in my applications running oracle. This behavior prevents developers to write portable code with DBAL. The solution is to make OCI8Driver commit everything after invoking oci_execute(), the same way how Doctrine_Adapter_Oracle works in Doctrine1. (https://github.com/doctrine/doctrine1/blob/master/lib/Doctrine/Adapter/Oracle.php)




        Hide
        Benjamin Eberlei added a comment -

        Fixed

        Show
        Benjamin Eberlei added a comment - Fixed
        Benjamin Eberlei made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 12086 ] jira-feedback2 [ 17671 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 17671 ] jira-feedback3 [ 20026 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DBAL-61, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Miloslav "adrive" Kmet
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: