1

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?

Eran Betzalel
  • 4,105
  • 3
  • 38
  • 66

2 Answers2

1

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.

Community
  • 1
  • 1
Eran Betzalel
  • 4,105
  • 3
  • 38
  • 66
0

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
  • 12,287
  • 1
  • 40
  • 62
  • 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 Sep 27 '09 at 01:02