Admin API UpdateDatasource function fails to set storage attribute to true.

Description

During our application startup, (via code) we run some one-time additional configuration options for the Lucee web context using the Admin API. The following snippet, creates the datasource for us; however, yields the storage option in the Administrator UI to not have the storage option selected. The admin UI works fine and allows us to toggle the flag on the created datasource.

In turn, the datasource cannot be used for session, client or log storage when this occurs.

adm = new Administrator('web', this.getAdminPassword()) adm.updateDatasource( name: 'cfvars', newname: 'cfvars', type: 'MSSQL', host: 'db1', database: 'cfvars', port: 2533, username: 'web', password: "", connectionLimit: 100, connectionTimeout: 10, storage: true, blob: true, clob: true );

We'll be using cfconfig as a workaround.

Environment

Docker Linux `FROM ortussolutions/commandbox:lucee5-alpine`

Activity

Show:

Pothys - MitrahSoft 12 March 2021 at 13:29

The issue was solved. So I mark this ticket as deployed.

Zac Spitzer 12 March 2021 at 12:34

Pothys - MitrahSoft 24 November 2020 at 13:50

This issue was fixed in lucee version 5.3.7.47. Could you please check with the latest version and report here back.

Zac Spitzer 29 March 2020 at 11:42

https://github.com/lucee/Lucee/pull/907

<cfscript> function testUpdateDatasource(adminType, password, name, bStorage){ var _admin = new Administrator(type=adminType, password=pwd); var before = _admin.getDatasource(name="#arguments.name#"); var args = { type: "#before.dbdriver#", password: "#arguments.password#", classname: "#before.class#", dsn: "#before.dsn#", name: "#before.name#", newName: "#before.name#", host: "#before.host#", database: "#before.database#", port: "#before.port#", timezone: "#before.timezone#", username: "#before.username#", password: "#before.password#", storage: "#arguments.bStorage#" }; _admin.updateDatasource(argumentCollection=args); var after = _admin.getDatasource(name="#arguments.name#"); if (after.storage != before.storage) throw message="ERROR: Storage doesn't match after updateDatasource"; } pwd="admin"; datasource = "log"; adminType = "server"; testUpdateDatasource(adminType, pwd, datasource, false); testUpdateDatasource(adminType, pwd, datasource, true); testUpdateDatasource(adminType, pwd, datasource, false); </cfscript>
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

Affects versions

Created 11 March 2020 at 16:19
Updated 12 March 2021 at 13:29
Resolved 12 March 2021 at 13:29

Flag notifications