Application-defined datasources not available in the psuedo-constructor

Description

After creating a datasource in Application.cfc, I would expect to be able to access it right away. The datasource is not defined, however, in the psuedo-constructor. The datasource can be accessed in lifecycle methods like onRequestStart, but not in the psuedo-constructor.

The datasource is available in the psuedo-constructor if it was defined in the administrator.

There is a workaround — that is to update the datasources using the cfapplication tag, but this shouldn't be necessary as we are still in the Application.cfc.

ACF 2016 allows me to use the datasource immediately.

You can use this gist to recreate (only two files and a datasource connection are needed):
https://gist.github.com/elpete/ae7b5926a2f8ee97b9c6058626cd5182

Environment

MacOS 10.13.2
Java 1.8.0_144
Lucee 5.2.5.20

Assignee

Michael Offner

Reporter

Eric Peterson

Priority

Critical

Labels

Fix versions

None

Sprint

None

Affects versions

Configure