Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2731

Error when inserting in oracle DB : ORA-01861: literal does not match format string

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:
      None
    • Environment:
      Symfony2 - Doctrine2 - Linux

      Description

      I moved my project from MySQL to Oracle, and I get this error when I try to insert into the database.

      This error is caused by the date format, in my form the date format is dd/mm/yyyy, so my question is HOW DOES SYMFONY2 GET THE DATE FORMAT BEFORE DB INSERT?

      I added this date_default_timezone_set("Europe/Paris"); to my config.php and app_dev.php, but nothing changed.

      An exception occurred while executing 'INSERT INTO arborescence (IDNT_ARBR, NOM_ARBR, DATE_CREATION, IDNT_SERV, IDNT_UTLS) VALUES (?, ?, ?, ?, ?)' with params [7, "B", "2013-10-09 00:00:00", 7, 1]:

      ORA-01861: literal does not match format string

      Any ideas on how to solve this would be really appreciated.

        Activity

        Abdelghafour IFTAH created issue -
        Hide
        Abdelghafour IFTAH added a comment -

        I solved this problem by adding the following code to : app/config/config.yml

        services:
        oracle.listener:
        class: Doctrine\DBAL\Event\Listeners\OracleSessionInit
        tags:

        • { name: doctrine.event_listener, event: postConnect }

        This seems to be a bug in Symfony2 DoctrineBundle. If we use the MySQL
        driver, the corresponding MysqlSessionInit is loaded properly in the
        Dependency Injection extension. But this doesn't happen with the
        OracleSessionInit class, if we use the Oracle driver.

        I hope someone is going to find this helpful.

        Respect,
        iftah

        Show
        Abdelghafour IFTAH added a comment - I solved this problem by adding the following code to : app/config/config.yml services: oracle.listener: class: Doctrine\DBAL\Event\Listeners\OracleSessionInit tags: { name: doctrine.event_listener, event: postConnect } This seems to be a bug in Symfony2 DoctrineBundle. If we use the MySQL driver, the corresponding MysqlSessionInit is loaded properly in the Dependency Injection extension. But this doesn't happen with the OracleSessionInit class, if we use the Oracle driver. I hope someone is going to find this helpful. Respect, iftah
        Hide
        Abdelghafour IFTAH added a comment -

        I solved this problem by adding the following code to : app/config/config.yml

        services:
        oracle.listener:
        class: Doctrine\DBAL\Event\Listeners\OracleSessionInit
        tags:

        • { name: doctrine.event_listener, event: postConnect }

        This seems to be a bug in the DoctrineBundle. If we use the MySQL driver, the corresponding MysqlSessionInit is loaded properly in the Dependency Injection extension. But this doesn't happen with the OracleSessionInit class, if you we the Oracle driver.

        Show
        Abdelghafour IFTAH added a comment - I solved this problem by adding the following code to : app/config/config.yml services: oracle.listener: class: Doctrine\DBAL\Event\Listeners\OracleSessionInit tags: { name: doctrine.event_listener, event: postConnect } This seems to be a bug in the DoctrineBundle. If we use the MySQL driver, the corresponding MysqlSessionInit is loaded properly in the Dependency Injection extension. But this doesn't happen with the OracleSessionInit class, if you we the Oracle driver.
        Abdelghafour IFTAH made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

        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=DDC-2731, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Abdelghafour IFTAH
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: