entity framework 5 - EF5 and Ado.Net -


I have an existing code that uses Ado.Net and I'm trying to integrate some new code Which uses the Entity Framework 5. For the concept as a proof, I wanted to try a transacted operation with both ado.net and EF5.

I tried to use the transaction skip but as I was using "two connections", I got an error about the promotion of the transaction and DTC is available.

Can I use the same connection to Edonate and EF5 to avoid the above problem? If so, any code example ....

Any other suggestion appreciated.

BTW, I am using the EF5 database first.

Thanks for advance help.

Regards, Travis

Yes, but only if you have a distributed transaction Coordinator (DTC) configured DTC transaction is very slow with local transactions.

This can help:

Another option is to obtain the EntityConnection object and obtain SqlConnection and use it in your ADO. Net command, but you have to be careful about it because if the inserted unit is settled, the connection can be closed.

Or when you make it, you can pass an EntityConnection in the context, so the only one connection used for both.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

jsp - Google line chart x-axis shrinks on transition -

java - Reaching JTextField in a DocumentListener -