cfadmin - UpdateDatasource does not create usable Datasource

Description

When I attempt to create/rename a datasource using the cfadmin tag, the datasource is created (and the connection validates) but then when I try to run a query right after the datasource is created any table I try and call a query against is returned "Invalid Object name".

<cfadmin action="updateDatasource" type="server" password="LUCEE_PW" classname="com.microsoft.jdbc.sqlserver.SQLServerDriver" dsn="jdbc:sqlserver://{host}:{port}" dbdriver="MSSQL" name="demolab8" newname="demolab8" host="HOST_NAME" database="demolab8" port="1433" dbusername="demolab8" dbpassword="DB_PW" connectionLimit="300" connectionTimeout="20" blob="false" clob="false" allowed_select="true" allowed_insert="true" allowed_update="true" allowed_delete="true" allowed_alter="true" allowed_drop="true" allowed_revoke="false" allowed_create="true" allowed_grant="true" custom="DATABASENAME=demolab8&amp;sendStringParametersAsUnicode=true&amp;SelectMethod=direct">

After the above script is run and after I get the error, if I try and validate the connection from Server Admin, it validates successfully. I can see the table exists in the database.

<cfquery name="site_info" datasource="demolab8">
select * from site_info where id = 1
</cfquery>

If I delete the datasource prior to running the updateDatasource script, I still receive the same error. However, if I delete the datasource and create the datasource using the Admin interface (using same info from updateDatasource), then the queries start working correctly.

In comparing the datasource entries in lucee-server.xml from when the datasource is created through the Admin interface and when it's created using the cfadmin tag, there's only 1 difference. When using the Admin interface, the "custom" attribute is pre-populated with information. When I try and take that same information (or any information) and place it in the cfadmin script, the "custom" attribute is cleared out. It always shows up in the config file as custom="".

Environment

None

Activity

Show:

Michael Offner 19 September 2016 at 14:51

it never was the intenion that this tag is used outside the lucee admin.
Because of that you should define the datasource inside the application.cfc in addition we plan tp extend the Administrator.cfc with support to define a datasource in the future.

Imported User 13 17 February 2015 at 15:31

After doing some more comparisons with the lucee-server.xml file after running the updateDatasource script and updating the datasource via the Admin interface, the only things that change are the custom parameters are added to the datasource and it looks like the password is updated/re-encrypted when using the Admin interface.

Also, after running the udpateDatasource script, if I go into the Admin interface, edit the datasource and then just save it, all the sudden the datasource starts working.

Won't Do

Details

Assignee

Reporter

Priority

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 13 February 2015 at 15:17
Updated 10 November 2021 at 08:52
Resolved 19 September 2016 at 14:52

Flag notifications