Skip to main content
March 13, 2012
Question

ColdFusion caching SQL Server credentials?

  • March 13, 2012
  • 1 reply
  • 3688 views

I have been using ColdFusion's storedProc() service for a while with no issue.  However, I have run into a scenario where I have a local stored procedure executing a remote stored procedure.  When I attempt this via ColdFusion, I receive a very cryptic error:

The DBMS has returned the command code 224...

The following is the code I am using:

variables.storedProcService = new storedProc();

variables.storedProcService.clear();

variables.storedProcService.setAttributes(datasource="DATASOURCE", procedure="STOREDPROCNAME");

variables.storedProcService.addParam(cfsqltype="CF_SQL_INTEGER", type="in", value=0);

variables.storedProcService.execute();

However, executing the exact same procedures from SQL Server Management Studio results in no issues.

Then, when I use the following code:

variables.storedProcService = new storedProc();

variables.storedProcService.clear();

variables.storedProcService.setAttributes(datasource="DATASOURCE", procedure="STOREDPROCNAME", username="USERNAME", password="PASSWORD");

variables.storedProcService.addParam(cfsqltype="CF_SQL_INTEGER", type="in", value=0);

variables.storedProcService.execute();

The execution runs without issue.  My question is this, does ColdFusion cache SQL Server/Datasource credentials?  Why does it [seem to] not use the credentials I provided in Jrun?

This topic has been closed for replies.

1 reply

March 14, 2012

HiTopp wrote:

variables.storedProcService = new storedProc();

variables.storedProcService.clear();
variables.storedProcService.setAttributes(datasource="DATASOURCE", procedure="STOREDPROCNAME", username="USERNAME", password="PASSWORD");
variables.storedProcService.addParam(cfsqltype="CF_SQL_INTEGER", type="in", value=0);
variables.storedProcService.execute();

The execution runs without issue.

I can actually just include the password attribute and the stored procedure runs just fine.

Owainnorth
Inspiring
March 14, 2012

Quick idea - try disabling the "Maintain Connections" checkbox in the datasource tab, it could be maintaining a connection rather than creating a new one.

March 14, 2012

Ah, quite possibly. Why aren't you using the native driver?


Honestly, I am not entirely sure.  I am not an expert in ColdFusion and the application I am supporting was using JNDI drivers before I started supporting it.