views:

74

answers:

1

Im running an ASP.NET MVC application hosted with Mosso, there are telling me that they cannot enable DTC because they run everything in medium trust.

So when executing code that references: TransactionScope I get the following error. The transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D024)

Is there anyway to get around this?

A: 

Are you using multiple data contexts? Using a single data context within a TransactionScope shouldn't force the transaction to be promoted to a distributed transaction. If you are using multiple data contexts, make sure that they are sharing the same connection. I would think that if they share a connection it would pick up the transaction associated with the scope and simply use it. If not, you might need to explicitly set the transaction on the context.

 using (var ts = new TransactionScope())
 {
      using (var dcOuter = new FooDataContext())
      {
           using (var dcInner = new BarDataContext( foo.Connection ))
           {
              ....
           }
      }
      ts.Complete();
 }
tvanfosson
I am not using multiple dataContexts, just trying to run the following code: using(TransactionScope Scope = new TransactionScope(TransactionScopeOption.RequiresNew, TransactionTimeOut)) { try { //meat of transaction... } catch(Exception ex) { throw ex; } Scope.Complete(); }
j0nscalet
I think it has to do with: http://stackoverflow.com/questions/794364/how-do-i-use-transactionscope-in-cand since mosso is medium trust I dont think they will enable 'Network DTC Access'.Any other thoughts?
j0nscalet