tracker issue : CF-4086564

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

Using clientInfo attribute with cfquery does not pass this metadata to MS SQL server

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/ThirdParty

Reporter/Name(from Bugbase): Jason Steinshouer / Jason Steinshouer (Jason Steinshouer)

Created: 11/11/2015

Components: Database

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Major / Some users will encounter

Locale/System: English / Win 2012 Server x64

Vote Count: 0

Problem Description:

When I create a structure and pass it to cfquery as described in the link below I do not see the metadata passed to our MS SQL server. 

https://helpx.adobe.com/coldfusion/developing-applications/accessing-and-using-data/updating-your-database/database-related-enhancements-in-coldfusion-10.html

I am using MS SQL 2008.

If I use this code

<cfscript> 
clientInfo = structNew();  
clientInfo.ApplicationName = "testApp"; 
</cfscript> 
<cfquery name="qName" datasource="#regdatasource#" clientInfo="#clientInfo#"> 
Select * from employees 
</cfquery>

I would expect this MS SQL query to return 'testApp' but it returns an empty string.

SELECT program_name FROM master..sysprocesses WHERE spid=@@spid

I also tried changing checking the client information checkboxes under the datasource advanced settings. Same result.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4086564

External Customer Info:
External Company:  
External Customer Name: Jason Steinshouer
External Customer Email:  
External Test Config: Running CF 11 on Windows 2012 and MS SQL 2008 Standard Edition on  Windows Server 2008 R2

Attachments:

Comments:

I am assuming that this feature would do something like Connection.setClientInfo() and pass the metadata that way as described here. http://media.datadirect.com/download/docs/jdbc/alljdbc/index.html#page/userguide/rfi1359985937883.html
Comment by External U.
5362 | November 11, 2015 02:20:04 PM GMT
Jason, We further investigated this behavior : SQL Server does not have an option to set the ApplicationName after a connection is established. Therefore : - when using Connection option ApplicationName, the Client Info is set on connection and is available in the master..sysprocesses table and through Connection.getClientInfo("ApplicationName"). - when using clientInfo.ApplicationName, the Client Info is set after connection and is only available through Connection.getClientInfo("ApplicationName"). This information will not be sent to the database and it is cached at the database driver level. If you want to store application name into master..sysprocesses table, then set the ApplicationName at the datasource level. I hope this answer your query, If you have any further doubt please reach out to us.
Comment by Nimit S.
5363 | April 11, 2016 11:08:04 AM GMT