Datasources defined in Application.cfc always get a timezone set

Description

When a datasource is defined in Application.cfc via `this.datasources` it will always have its timezone property set, even when it is not specified in the config struct. This is different behavior than when a datasource is specified in the admin where when the timezone is not specified, the datasource has a null value for its timezone.

This particularly caused me confusion because the datasource specified via application.cfc with no timezone will get the timezone of the server Lucee is running on, even if the timezone specified for Lucee is different. I believe this is happening because a null or missing timzone key in the config struct is not treated as null, but as an empty string - and there is an entry in TimeZoneUtil.java for an empty string:

Environment

None

Activity

John Berquist 
4 February 2021 at 16:28

The fix looks good to me. Thank you very much!

Pothys - MitrahSoft 
4 February 2021 at 06:30

This issue was fixed from lucee version 5.3.8.126-SNAPSHOT onwards. Could you please check with this version and report here back.

https://github.com/lucee/Lucee/commit/3a96baf454ea16733c130bea3d4e0a4e84919ce3

Pothys - MitrahSoft 
10 December 2020 at 15:58
(edited)

I've changed the testcase using H2 datasource.

Pull Request: https://github.com/lucee/Lucee/pull/1117

Zac Spitzer 
8 December 2020 at 12:16

the test case broke the build

Michael Offner 
4 December 2020 at 16:58

can you please change the test case to use H2 instead of MSSQL

please always use H2 when we have a general datasource test, only use MSSQL,MySQL,Postgre when a ticket is about that datasource type.

H2 test cases work everywhere, MSSQL only if MSSQl is available in the env.

Fixed

Details

Assignee

Reporter

Priority

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Created 28 May 2020 at 20:15
Updated 4 March 2021 at 15:22
Resolved 4 March 2021 at 15:22