views:

70

answers:

2

I use L2S at my module. The problem occurs while I'm using the default DNN entities at the same TransactionScope with my L2S data access, then I get a DTC request which I want to avoid.

How can I share the connection/transaction for both DNN entities and my L2S data access?

A: 

I don't know about DNN, but the L2S datacontext has a constructor that takes a SqlConnection (well, a IDbConnection of a SqlConnection) as a parameter. So if you have a connection already established, just pass it in to the L2S datacontext when you create a new instance.

KristoferA - Huagati.com
DNN entities create a connection only to access SP and then it closes. It appears that you can't pass a connection object to these entities as suggested here: http://stackoverflow.com/questions/1478612/how-to-use-transactions-in-dotnetnuke/1479382#1479382.
Eran Betzalel
+1  A: 

Sadly, as stated here - transactions are currently not the strong part of DNN (5.1.X), thus L2S operations should not be entangled with DNN core operations to prevent transactions escalation.

Eran Betzalel