0

I am using a connection string to connect to an Oracle Database. Everything works fine when i run my code locally but when I deploy the same code to PCF I get "ORA-00604: error occurred at recursive SQL level 1 and ORA-01882: timezone region not found".

I get this error while executing the line connection.Open(). Until there everything works fine. But this line works when I run locally.

Can anyone please help me on this? Is this a PCF issue?

Indra K
  • 37
  • 1
  • 6
  • It is likely to be an environmental config issue: being cloud, the tricky thing is establishing whether it's part of the config you have control over. – APC Nov 29 '18 at 16:50
  • Is there any work around for this as I need to use PCF only! – Indra K Nov 29 '18 at 17:38
  • Possible duplicate of [ORA-01882: timezone region not found](https://stackoverflow.com/questions/9156379/ora-01882-timezone-region-not-found) – krokodilko Nov 29 '18 at 17:43
  • @krokodilko I am not using JDBC, I am trying to connect to Oracle DB via C# code in .net core – Indra K Nov 29 '18 at 17:55
  • +1 seems like there's a config missing. Did you see this note which is Windows specific -> https://stackoverflow.com/a/19927361/1585136. Otherwise check the Oracle docs to see how you set the timezone for the .NET client. If it's an environment variable, you can set it via `cf set-env `. – Daniel Mikusa Dec 04 '18 at 18:12
  • 1
    I added the TZ field in the manifest.yml file before deploying to PCF. For eg- TZ : Asia/Calcutta. It's working fine now. – Indra K Dec 07 '18 at 09:35
  • Hi Shaleen, Thanks a lot. This solution means a lot for me after long search. – Sikindar Jun 26 '19 at 20:08
  • 1
    @Sikindar Thanks... Please upvote – Indra K Jun 27 '19 at 15:50

1 Answers1

1

From this thread

1) The solution is to use a timezone supported by the database. This can be done by setting the TZ environment variable. When TZ is set, its value will be used rather than the operating system default timezone.

2) ... set the connection property oracle.jdbc.timezoneAsRegion to "false". This reverts to the old style of session timezone behavior.

To use method 1 use the following commands:

cf set-env <app-name> TZ '<your-timezone>'

cf restage <app-name>

To use method 2 use the following commands:

cf set-env <app-name> JAVA_OPTS '-Doracle.jdbc.timezoneAsRegion=false'

cf restage <app-name>