bennadel / ColdFusion-Per-App-Datasource-Test

Reproduction case for per-application datasources not working in ColdFusion 2023.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ColdFusion Per-Application Datasource Test

This is a demo / reproduction repository to showcase that per-application datasources were working in ColdFusion 2021 but do not seem to work with ColdFusion 2023 (at least not with the same code).

I'm going to use Docker with the OrtusSolutions images since these seem to be the only ones that will run on Apple M1 silicon. Each app has its own copy of the ColdFusion code since the server-startup scripts will collide if we try to mount the same volume for each app.


Each app uses the following per-application configuration code:

component {

	this.datasources = {
		"test": {
			username: "root",
			password: "password",
			driver: "MySQL",
			class: "com.mysql.cj.jdbc.Driver",
			url: "jdbc:mysql://mysql:3306/demo"
		}
	};
	this.datasource = "test";

}

Adobe ColdFusion 2021

When the application starts-up and you hit the index.cfm, you see the expected output:

Adobe ColdFusion 2023

When the application starts-up and you hit the index.cfm, you see two different errors. First, you see an error about the GraphQL client not being installed:

Refreshing the page removes the GraphQL error but then shows the datasource error:

Neither of these errors is expected.


Update On Adobe ColdFusion 2023

Dan G. Switzer, II had a comment on Twitter that the GraphQL error that I'm seeing might be a clue to the cause. He posited that once GraphQL was breaking, then the datasource wasn't going to work. So, I tried:

  • Going into the 2023 CFAadmin.
  • Installing the GraphQL package.
  • Restarting the 2023 container.

And, kablamo!

It's alive!!!

About

Reproduction case for per-application datasources not working in ColdFusion 2023.


Languages

Language:ColdFusion 100.0%