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?
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.
I kept attempting to troubleshoot the problem from a different standpoint because an associate of mine was able to run the stored procedures with no problem. He did not have to include the credentials in the procedure call and his CFAdmin datasources used the JNDI driver.
So I compared our two ColdFusion environments and noticed that he was using the System Registry to store client variables (i.e. CFID, CFTOKEN, etc) instead of a database. I switch my environment to use the System Registry and the two procedure calls worked just fine. Isn't using a database for this purpose a useable replacement for the System Registry? Why would using a database not work in this instance?
North America
Europe, Middle East and Africa
Asia Pacific