-
-
Notifications
You must be signed in to change notification settings - Fork 449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OracleSessionInit is NOT loaded properly in the Dependency Injection #217
Comments
@beberlei is the OracleSessionInit listener always needed when using Oracle or only in some cases ? |
I only get an error when I'm trying to insert a DateTime field type, so I'm not sure if it is always needed when using Oracle. |
@iftah If it is required as soon as you have a date field in the project, I would still consider it as required as this is a common case. My question was more about being always required or only for some versions of oracle |
I'm only using oracle 11g, I can't tell about the other versions. |
Hi I have try to setup OracleSessionInit but it does not help. My Entity /** @Orm\Column(type="string") */ public function __construct() { OR /** @Orm\Column(type="datetime") */ public function __construct() { But always is the same error: Any ideas what is wrong ? Thanks |
@elemele What is the column declaration in your database (not mapping)? I guess the string format to be inserted depends on the |
@deeky666 In database I have type DATE. I have made simple test in my action and it helped: public function detailsAction() if I do this in the configuration file I will let you know. Thanks |
The fixed proposed by @iftah works for me too, but I don't really know why do I have to initialize this. ¿Is this considered a bug? |
@iftah fix works for me too (Oracle 11g).
The
@DoctrineCoreDevelopers: Since this configuration is required, why not making it default in Doctrine? |
This is documented in http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/events.html We don't want to make it the default, since this is affects only oracle sessions. Additionally, changing defaults is a major BC break in this case. |
Can anyone help me where I set this in laravel? services: |
well, I don't know how the DBAL integration into Laravel is configured, but I know for sure that this is the wrong place to ask. DoctrineBundle is only about integrating Doctrine with Symfony 2. you need to contact the maintainers of the laravel integration |
I am using oracle11g, I have fixed the problem with @iftah config code when using query builder. But why? |
@jljunior3, maybe is too late. But I have solved this in laravel at the moment when you create the connection passing the
|
For those who may face the same problem with Zend2, and Basing on the answer of @deeky666 I have get it fixed by replacing the line
in the file: EntityManageFactory.php, under the Function createService.php
|
@yaziderman please don't monkey-patch libraries. Also, absolutely DO NOT suggest others to do that. What you want in your case is using a delegator factory (docs here) that acts on the
|
i have the same problem, and by added oracle listener haven't any effect on problem when we use more then database other oracle in the same time. |
@karousn Did you specify connection name with the tag? |
i forget to specify the connection, thank's @kimhemsoe it is work now |
Hi,
I moved my project from MySQL to Oracle, and I get this error when I try to insert into the database.
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
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.
Respectfully,
iftah
The text was updated successfully, but these errors were encountered: