Transaction Issue with remote database

220 views
Skip to first unread message

Brett Bailey

unread,
May 24, 2013, 9:25:14 AM5/24/13
to nginn-me...@googlegroups.com
Hi

We've just deployed our system into production and  are getting an exception when handling messages from nginn.

I've attached the error log, the gist of it is : "System.Data.ProviderIncompatibleException: The provider did not return a ProviderManifestToken string. ---> System.Transactions.TransactionException: The operation is not valid for the state of the transaction."

In our setup we have our own database and nginn queues in separate databases on the same sql server.  
We access our database using Entity Framework.  
The handler app is a windows service on a different server to the database.  
It runs as an AD User which has permissions to access both databases on the sql box.
The exception is thrown at the point that we write to our application database.
We have the MSDTC windows service running on both machines.


If I move the windows service to run on the same machine on which the database is deployed the problem goes away.

Any Ideas?

Brett

errorlog.txt

Rafal Gwizdala

unread,
May 24, 2013, 9:39:01 AM5/24/13
to nginn-me...@googlegroups.com
Hi Brett, 
I'll try to be helpful but I havent's seen such error before (however, I suspect some security issue)
1. Can you examine if there's an InnerException attached to System.Data.ProviderIncompatibleException? I found some hints to first check the innerException for the real cause, for example authentication problems (http://stackoverflow.com/questions/5423278/ef-4-1-exception-the-provider-did-not-return-a-providermanifesttoken-string)
2. Are you mixing windows authentication with SQL server auth? If so, can you try using sql server auth on both services? I have a similar setup (app database + separate MQ database on same server) running without problems with SQL server auth.
 
R

Brett Bailey

unread,
May 24, 2013, 9:52:19 AM5/24/13
to nginn-me...@googlegroups.com
Hi Rafal

The inner exception is System.Transactions.TransactionException: The operation is not valid for the state of the transaction. Sorry if I didnt make this clear in the first post.

As for the the mixed authentication, that could have been the issue.  I'll try that out when we deploy again next week  :-)

~Brett
Message has been deleted

Rafal Gwizdala

unread,
May 31, 2014, 6:16:13 AM5/31/14
to nginn-me...@googlegroups.com
Ajeeth, promotion to the DTC transaction is a normal thing if you open more than one DB connection inside a .Net managed transaction.
So if DTC is unavailable you'll get an error. 
Then you have some choice how you decide to solve it
- enable the DTC
- or suppress .Net transactions (what you've done)
- you  can also try to share the database connection between nginn-messagebus and the Entity Framework-based data access layer. Some information is available here 
(but this article is quite old now and some API might have changed)
This option isn't always possible, it depends on whether your EF code can use an externally managed db connection. I'm doing that in my development to avoid distributed transactions at all.

Best regards
Rafal




On Sat, May 31, 2014 at 11:56 AM, Ajeeth <ajee...@gmail.com> wrote:
Hi Even,
 
I am facing the same issue with an exception of MSDTC is disabled. I had to suppress the transaction in Transactionscope.
 
Thanks,
Ajeeth

--
You received this message because you are subscribed to the Google Groups "nginn-messagebus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nginn-messageb...@googlegroups.com.
To post to this group, send email to nginn-me...@googlegroups.com.
Visit this group at http://groups.google.com/group/nginn-messagebus.

Reply all
Reply to author
Forward
0 new messages