tracker issue : CF-4204002

select a category, or use search below
(searches all categories and all time range)
Title:

Defaults not set or settable in setMSSQL

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Mark P. / ()

Created: 02/04/2019

Components: Administrator, Admin API

Versions: 2016

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: 2018.0.01.311402 / CF2016U12,CF2018U5

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Win 2016

Vote Count: 1

When creating a DSN for MSSQL via setMSSQL() function the following are not set to any default values like they are when using the GUI:

type
vendor
cf_pooled
supportlinks

In addition, specifying a value in setMSSQL only sets a value for supportlinks.  The only way to set a value for the others is to edit the DSN in the GUI.

<cfscript>
    adminObj = createObject("component","cfide.adminapi.administrator");
    adminObj.login("xxxxxxxxxxxxx");
    myObj = createObject("component","cfide.adminapi.DataSource");

myObj.setMSSQL(
	type="ddtek",
        vendor="sqlserver",
        supportlinks="true",
        cf_pooled="true",
        name="Testing",
        host="xxxxxxxxxxxxxxxxxxxxx",
        database="Testing",
        username="xxxxxxxxxxx",
        password="xxxxxxxxxxxx"
        
       );
</cfscript>

Attachments:

Comments:

Hi Mark, I asked the same during CF9 PR in 2009. Here is the question I asked, and scroll to bottom for Adobe's answer. My question: ----------- If an MSSQL datasource is added via CF Administrator, the following are set by default: - type - vendor - cf_pooled - usespylog - spylogfile - supportlinks - maxpooledstatements key in connectionprops struct - "MaxPooledStatements" parameter in url string But those are not set by default, if datasource is added via Admin API. Bug? Also, setMSSQL() *does* support "type" & "vendor" parameters. But, even if those are passed in, they are still not returned via Admin API. Bug? Also, regarding "maxpooledstatements" key in "connectionprops" struct, there are a couple of "maxpooledstatements" keys returned.. the one directly in the result is always returned, but the one in the result.connectionprops struct is only returned if "maxpooledstatements" is passed into setMSSQL(). Bug? Shouldn’t the Admin API mirror the CF Admin? Or is the Admin API just a work-in-progress w/ gotchas? ----------- Adobe's answer: ----------- You are seeing the differences in behavior between Admin pages and adminAPI because of default values. That is, all fields have default values in admin pages, which is not the case with adminAPI. For example, in case of usespylog, by default false is set in Administrator as we have to show a default value, and no value is set in adminAPI as they are not required. In addition to that, we don’t return type and vendor in the datasource, they are just required to make check some conditions and is not set in the datasource as such. Cf_pooled and maxpooledstatements are related and when no value is passed in the adminAPI, even though a default value of 1000 is returned , maxpooledstatements are not set in the connection string. It will be set only when user sets maxpooledstatements. ----------- Summary: Consistency _should_ and _could_ be done. But.. Thanks!, -Aaron
Comment by Aaron N.
30188 | February 05, 2019 10:51:32 AM GMT
+1 - a decade old issue
Vote by Aaron N.
30189 | February 05, 2019 10:51:49 AM GMT
Thanks Aaron. I'm shaking my head while reading the response from Adobe. Yes, adminAPI is setting a different default value (including no value) to the Admin page.....and? Your summary is pretty much spot on. I have a feeling this is going to be a repeat of trying to get them to support passing AD credentials to the DB. Not the AD details of the service account running CF but per DB credentials. I gave up on that after .... maybe a decade?
Comment by Mark P.
30197 | February 06, 2019 12:35:40 AM GMT