This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I'm trying to implement enlisting ambient transaction(created by Transaction scope) after UnitOfWork has opened connection. I think ADO.NET, SqlConnection#EnlistTransaction enables opend connection to enlist transaction. I want to use this, but UnitOfWork#ConnectionStrategy#Connetion is not public, but protected.
Could you help me how to implement this?
I'm using SQL Server 2008.
|
|
|
The only way I can think of to do this would be to create a custom connection strategy to gain access to the connection. For example, create an EnlistableConnectionStrategy which is the same as the default connection strategy but implements an additional Enlist method that your application can call. The default connection strategy class isn't public so you can't inherit from it but here's the code if you want to use it as a basis for an EnlistableConnectionStrategy class. See also the CloseableConnectionStrategy example at http://www.mindscapehq.com/forums/Post.aspx?ThreadID=2338&PostID=6724 for another example. internal class DefaultConnectionStrategy : ConnectionStrategy |
|
|
Hi, Ivan. Thank you for your advice. I'm trying EnlistableConnectionStrategy implementation.
|
|