Skip navigation
HiTopp
Currently Being Moderated

ColdFusion caching SQL Server credentials?

Mar 13, 2012 1:10 PM

Tags: #cache #coldfusion9 #stored_procedure #cfstoredproc #credentials #sql_server

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?

 
Replies
  • Currently Being Moderated
    Mar 14, 2012 7:38 AM   in reply to HiTopp

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

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 14, 2012 8:25 AM   in reply to HiTopp

    In CFAdmin go to the DSN, click "Show Advanced Settings" and it's in there. Should then create a new connection for every request.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 14, 2012 8:35 AM   in reply to HiTopp

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

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 14, 2012 8:38 AM   in reply to HiTopp

    In which case it might be worth creating a second DSN with the native driver, and use that; it may sort your issue.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 14, 2012 8:49 AM   in reply to HiTopp

    Honestly I have no idea. Just throwing ideas out there.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points