PRB: Changing Database Context Can Lead to Unexpected Results

Last reviewed: October 7, 1997
Article ID: Q166108
The information in this article applies to:
  • Microsoft Transaction Server, version 1.0

SUMMARY

With connection pooling enabled, you must ensure that if your component changes the database context of a connection, it does so via the ODBC SQL_CURRENT_QUALIFIER connection attribute, and not via the Transact-SQL "use some_other_database" command. Otherwise, the next component that gets the connection will be connected to the wrong database.

MORE INFORMATION

The connection pooling mechanism can detect all changes done through the ODBC API, but it cannot detect changes done in Transact-SQL. Therefore, a statement like "use some_other_database" can set the current database to some unexpected database. When the connection is recycled, the connection is pointing to some_other_database rather than to the original, but the connection pooling mechanism does not know that.

Microsoft Transaction Server always enables connection pooling.


Additional query words: open connectivity
Keywords : kbprg TSrvODBC
Version : 1.0
Platform : WINDOWS
Issue type : kbprb


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 7, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.