this is really two questions in one I guess.We've developed a .Net app that accesses an Oracle database, and have noticed that after changing the user's Oracle password, the app continues to work for a short time with the old password in the connection string. Presumably this is something to do with the way existing connections are pooled?When first investigating this we tried turning off pooling in the connection string, however the app wouldn't work, throwing the error "Unable to enlist in a distributed transaction" at the point it tries to open a connection. While we probably wouldn't want to turn off connection pooling in a production app, I'm curious as to why MSDTC seems to need it?We are using Oracle 11g (11.1.2) and latest ODP.Net (11.2 I think).Thanks in advanceAndy 解决方案 Please see some of the finding below:For Question One: (application still connected with old DB password)If we connect the database with connection pooling option, connection pool manager would create and maintain the number of connection sessions when first calling the open or close of OracleConnection object. (number of this connection sessions depend on "min" & "max" pool size in connection string). In Oracle, I think you could check active session like:SELECT s.inst_id, s.sid, s.serial#, p.spid, s.username, s.programFROM gv$session s JOIN gv$process p ON p.addr = s.paddr AND p.inst_id = s.inst_idWHERE s.type != 'BACKGROUND';And according to Oracle doc, this connection pooling service will close the connection sessions after 3 minutes of in-active state. [ http://docs.oracle.com/html/E10927_01/featConnecting.htm ]So the most possible reason could be, your application still connected to the database by using this Pool and still connected for a short time, even after you changed the database password.There could be also one possibility of "Oracle Client Cache" feature in ODP.net. But not quite sure, you can check at, [ http://www.oracle.com/technetwork/issue-archive/2008/08-jul/o48odpnet-098170.html ]For Question Two: (why MSDTC needed)If you are using nested Database connection in your code, it will be promoted to DTC. [ http://petermeinl.wordpress.com/2011/03/13/avoiding-unwanted-escalation-to-distributed-transactions/ ] Actually there was Oracle Service for Microsoft Transaction Server (OraMTS) act as among ODP.net, DTC, and Oracle Database.But you didn't happend this problem (MSDTC) before disabled the connection pooling. It seems like your code is reusing the same connection out of undelining connection pool, and it might eliminate the need to promote DTC. There was similar question on StaffOverflow. [ Why isn't my transaction escalating to DTC? ] 这篇关于Oracle ODP.Net和连接池的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!