Hi,
I have a stupid question and haven't found any documentation yet to help me out... hoping you smart people can :)
Looking at integrating transactions into our classes. I am updating all of our data access methods to use the ConnectionManager instead of just new connections. Because we are using stored procs, I would like to continue using the command object, which I now need to pass the active transaction to. I started the transaction from the connection manager in my UofW with the following line "conn.Connection.BeginTransaction()" with conn being my connection manager object.
Then I go to add my new obejct... I am wondering, is there a way to access the transaction object from the connectionManager object or do I need to do a
"Dim trans As SqlTransaction = conn.Connection.BeginTransactuin()" and then pass that through somehow? if so, would be your suggested method for passign that guy around?
Thanks in advance :-)
You should probably use the TransactionManager type instead of ConnectionManager.
The way ADO.NET works, the connection is unaware of things like transactions. But the transaction object is very much aware of the connection, and exposes the connection as a property.
The Csla.Data namespace includes manager types for connections, transactions, object contexts, entity contexts, and data contexts - trying to provide a way to reuse all these top-level data constructs. These are documented in the Using CSLA 4: Data Access ebook.
This resolved both of my issues, thanks :)
Copyright (c) Marimer LLC