First off, let me say huge thanks to Brenton Webster who provide the virtually all of the code responsible for the transaction enhancements in the set. Had it not been for Brenton, I might never experience the utter coolness of [ThreadStatic].
So there's some new stuff here. First, since I really don't feel like having the debate about Properties vs. Methods and Lazy Loading again, I've added support for both. Using the boolean parameters generateLazyLoads and generateRelatedTablesAsProperties on the provider, you can determine the output of the related table methods. Personally, I'm happy with methods and chose them because it the approach taken by datasets, and could care less about lazy loading since I always assign the results of external call to local variables, but I've already spent more time debating this than it took to add the capability, so hopefully this will be at least close to the final word on it.
Next up, the SqlDataProvider (other providers at a later date) now supports runtime connection string switching. Big thanks again to Brenton on this one, since the code he provided for the transaction handling made adding this capability very simple. There are really only two command you need to know to use it. To change the connection string currently being used by the provider, use:
SqlConnectionContext.Create("your connection string here");
and to return it to the provider default, use:
SqlConnectionContext.Reset();
That's all there is to it.
Finally, there are the transaction enhancements I spoke of earlier. As Brenton noted there two issues with relying on System.Transactions for transaction performance: Performance, and. I've incorporated his very elegant solution, so you can now use transactions (again SqlDataProvider only for now) without the mentioned limitations. At the most base level, the syntax is as follows:
using (TransactionScope scope = new TransactionScope())
{
//Do stuff
....
scope.Complete();
}
So beat these up and find the stuff that I screwed up, so that we can move on to Beta 4.
Fixes
- Work Item 9648 - SubSonicCentral web.config - invalid path to templateDirectory breaks Configuration Builder page
- Work Item 9516 - SubSonic and System.Transaction support
- Work Item 9691 - Dropdown control needs orderField
- Work Item 9656 - Generated ActiveRecord "primary key methods" --> properties
- Work Item 9270 - SqlDataProvider - single method for creation of new connection
Download