Skip to content
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

OraclePlatorm/OracleSessionInit datetimez format disconnect #2332

Closed
dadamssg opened this issue Mar 4, 2016 · 2 comments
Closed

OraclePlatorm/OracleSessionInit datetimez format disconnect #2332

dadamssg opened this issue Mar 4, 2016 · 2 comments

Comments

@dadamssg
Copy link

dadamssg commented Mar 4, 2016

I encountered my dates having the wrong offset when using the datetimetz type in the orm. I finally tracked it down to the OracleSessionInit's NLS_TIMESTAMP_TZ_FORMAT session variable being set incorrectly. As you can see it defaults to setting it with a space between the time and the offset while OraclePlatform class's format does not have a space.

I fixed this by overriding the arguments passed to OracleSessionInit in my container configuration and everything is working as expected.

services:
    oci8.listener:
        class: Doctrine\DBAL\Event\Listeners\OracleSessionInit
        arguments:
            - { NLS_TIMESTAMP_TZ_FORMAT: "YYYY-MM-DD HH24:MI:SSTZH:TZM" }
        tags:
            - { name: doctrine.event_listener, event: postConnect } 

It caused my quite the headache and it seems to me that this issue exists across all Oracle versions but i'm not sure. This is the first time I've ever used Oracle. My version info below.

Oracle Database 12c Release 12.1.0.1.0 - 64bit Production
PL/SQL Release 12.1.0.1.0 - Production
"CORE   12.1.0.1.0  Production"
TNS for Linux: Version 12.1.0.1.0 - Production
NLSRTL Version 12.1.0.1.0 - Production
@dadamssg dadamssg changed the title OraclePlatorm/OracleSessionInit format disconnect OraclePlatorm/OracleSessionInit datetimez format disconnect Mar 7, 2016
@bohanyang
Copy link

Big THANK YOU ! You solved my problem!

@morozov morozov closed this as completed Dec 12, 2021
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants