I am using oracle and I am recieving this error:
Could not convert database value \"17-NOV-11 12.17.33 AM\" to Doctrine Type datetime. Expected format: Y-
I think this link will help you :
Connecting to Oracle with Symfony2 and Doctrine 2.
https://gist.github.com/johnkary/6481664#file-oracledoctrinetypemappinglistener-php
Well It appears I will answer myself this time.
You have to add it as a service using the event tag.
app/config/config.yml
services:
my.listener:
class: Doctrine\DBAL\Event\Listeners\OracleSessionInit
tags:
- { name: doctrine.event_listener, event: postConnect }
my.listener is an arbitrary name for the listener.
In my case Oracle was a second connection (stored under oracle key). The application also used PostgreSQL (stored under default key).
The problem was that Listener was executed on the default database (PostgreSQL). So I changed code to:
services:
my.oracle.listener:
class: Doctrine\DBAL\Event\Listeners\OracleSessionInit
tags:
- { name: doctrine.event_listener, event: postConnect, connection: oracle }
And all works fine!