Domanda

I have two different C++ ISAPI DLLs that have been setup and configured for IIS 7 to use as web applications. They are setup using different application pools that are running under different domain user accounts. The problem that I am having is that, once one of the applications connects to SQL, the other application cannot. There are no differences in code between how the applications attempt to establish the connection – they both call the same static library method with identical parameters. The only way to get the second application to connect to SQL is to set its Application Pool user to the same domain user as the first application or vice versa (which rules out one user having insufficient permissions). I have double checked that ODBC connection pooling is turned on for the SQL Driver and I've monitored the ODBC Data Source Administrator Trace logs. If I monitor the trace log while both application pools are running under different users, SQLAllocHandle shows up successfully for both enter and exit in the Trace, but SQLDriverConnect will only succeed for both enter and exit for the first application that calls it. When the second application calls SQLDriverConnect with the exact same parameters, the trace only shows enter and debug logs also indicate that this function call never returns. Packet traces indicate that the second application never even attempts to connect to the SQL server. However, the first application will connect just fine and running a profiler in SQL will show proper execution of SQL statements. These applications ran just fine using the same multi-user configuration on Windows 2003 x86 under IIS 6 and older versions of the ODBC drivers.

I am hoping that there is a simple ODBC setting that I've missed, but my searches come up empty. Any help anyone can provide would be greatly appreciated, thanks in advance.

È stato utile?

Soluzione

After over a week of troubleshooting and talking with Microsoft, we've finally found a solution. From what Microsoft told us, they changed the way that processes can interact with each other between 2003 and 2008 and using our static linked library like we were was causing a locking issue when it was running under different users. When we introduced a new thread before calling the ODBC connector, everything works fine.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top