Confusion about DTC/enlisting transactions
Hi everyone, our organisation uses Oracle 11g R2 and ODP.Net v4 11.2 in a .Net 4 app and I've been asked to run some tests to see how it copes with connection pooling switched off. While it's unlikely a customer would want to turn off connection pooling, I nevertheless have to test this scenario.
When I change the connection string to "Pooling=false" the app throws the exception "Unable to enlist in a distributed transaction" when attempting to open a connection. The connection string includes "Enlist=true" by the way, and if I change this to false it works. The confusing part is that the connection isn't wrapped in a System.Transactions.TransactionScope() - it's only reading data. We do use TransactionScope elsewhere however. The documentation around DTC, the "enlist" setting, and promotable transactions are a bit unclear, but almost suggests that when enlist=true the connection will be enlisted in an implicit transaction, even if it's not wrapped in a TransactionScope?
And why does ODP.Net seem to rely on connection pooling in order to enlist a transaction?
I've also tried using the Component Services MMC snap-in to view the DTC transactions, and regardless of whether connection pooling is on or off, enlist is true or false, or a TransactionScope has been used or not, a transaction still seems to appear in the console whenever our app performs some database operation. Or am I misunderstanding something?
Our app only connects to a single database, although it may have two or three connections open under different user accounts. I've read somewhere that we shouldn't even need to use DTC when connecting to a single database. Is this correct, and if so what connection string settings should be used regards the above?
Many thanks in anticipation
Andrew