You're staring at CONTEXT_E_NOTRANSACTION (0X8004E027) and your app just died. I've seen this one dozens of times — usually when a COM+ component tries to do database work outside a transaction context. It's annoying, but it's fixable. Let's get you sorted.
The Quick Fix: Restart the COM+ Application
Nine times out of ten, this is a stale transaction context. The component's sitting in memory with a busted transaction object. Restarting the COM+ app clears that out.
- Open Component Services. Press
Win + R, typedcomcnfg, hit Enter. - Expand Component Services > Computers > My Computer > COM+ Applications.
- Find the application that's throwing the error. Right-click it and choose Shut down.
- Wait 5-10 seconds. You'll see the application disappear from the list.
- Right-click the COM+ Applications folder and select New > Application.
- Choose Create an empty application, give it the same name as the one you shut down.
- Leave activation as Server application, click Next, finish the wizard.
After that, restart your app or service. The error should be gone. If the app won't restart or you can't find it, reboot the server — it's blunt, but it works.
Why This Happens
COM+ components run inside a context — a wrapper that tracks things like transactions, security, and object pooling. When your component calls GetObjectContext or tries to participate in a distributed transaction, it expects that context to have a valid transaction object. If that transaction got timed out, rolled back, or never started, you get 0X8004E027.
Common triggers:
- A database connection takes too long, so the transaction times out.
- Your code calls
SetCompleteorSetAborton a stale context. - IIS recycles the app pool, killing the transaction mid-flight.
- The DTC (Distributed Transaction Coordinator) service stopped or failed.
The restart clears the component's cached context. The new context starts fresh, and the transaction gets created properly.
Less Common Variations
DTC Service Stopped
If restarting the COM+ app doesn't fix it, check the DTC. Open Services (services.msc). Look for Distributed Transaction Coordinator. If it's stopped, right-click and Start. Set it to Automatic so it starts with Windows.
After starting DTC, restart the COM+ app again. You'll see the transaction coordinator register the new transaction.
Component Not Registered for Transactions
Sometimes the component itself isn't set up to require a transaction. In Component Services, right-click your component under the application, select Properties. Go to the Transactions tab. Set Transaction support to Required or Requires New. Click OK, then shut down and restart the app.
Corrupted Component Registration
If the component's DLL got updated but not re-registered, you'll get this error. Open a command prompt as admin. Run:
regsvr32 /u yourcomponent.dll
regsvr32 yourcomponent.dll
Then restart the COM+ application. The transaction context picks up the new registration.
Network Issues with Remote Transactions
If your COM+ app talks to a remote database or another COM+ server, network problems can kill the transaction. Check firewall rules — DTC uses ports 135 and dynamic TCP ports (usually 5000-5100). Open those between the two machines. Then restart both DTC services.
Prevention
You don't want to babysit this error. Here's how to stop it coming back:
- Set transaction timeouts in code. In your .NET or VB component, set
TransactionTimeoutto something realistic — 30 seconds is usually plenty. That prevents long-running queries from timing out mid-transaction. - Always call SetComplete or SetAbort. Every method that starts a transaction must end with one of those. If you leave it dangling, the next call inherits a dead context.
- Monitor DTC health. Set up an alert in your monitoring tool (like SCOM or Nagios) to check the DTC service every 5 minutes. If it stops, you'll know before users do.
- Keep COM+ app pools warm. In IIS, configure the app pool to not recycle too aggressively. Set idle timeout to 0 if possible, or recycle during off-peak hours only. Recycling kills transactions.
- Test after updates. Every time you patch a COM+ DLL or update the server, test the transaction path immediately. It catches regressions early.
That's it. You've seen the fix, the reasons behind it, and the edge cases. Next time 0X8004E027 pops up, you'll know exactly where to look.