Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 27th, 2006, 04:49 PM
Registered User
 
Join Date: Nov 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 3 - Transactions

Is a simple question... In this chapter you talk about ADO.NET transactions, but using transactions inside SQL Server is not the better choice?
I'm in chapter 3 and I'm very happy with your book. It's my 4 book in ASP.NET 2.0 of WROX taht i'm reading.
Cheers!!!
Thanks!

 
Old November 27th, 2006, 11:13 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Keeping transactions in the DB is the best choice, but requires a lot of stored procs, and can make certain kinds of processing more difficult since the C# code would have less control. You couldn't easily call 3 procs in a row on the same transaction. You could have a 4th proc that calls the other 3, or you can roll all the functionality into one proc. But regardless of how you do it, it can become messy.

Allowing C# to control transactions also makes it easier to include other non-SQL processing in the mix. You might do some SQL updates and then call a web service. If something goes wrong with the web service call, you can easily roll back the SQL updates.

For a small site like TBH, it's probably fine to keep most transactions in the DB. But as it scales up in size it would become a lot more difficult. I know of one company with over 1500 stored procedures because they require their coders to do everything with stored procs. This kind of thing almost demands a fulltime stored proc librarian who can coordinate the use of all of them. Maintenance also becomes extremely complex because their are a lot of different procs tied to various tables.

Eric

 
Old November 28th, 2006, 06:25 AM
Registered User
 
Join Date: Nov 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Englere,
When you refer to C# is the same for VB.NET, write?
You opened my eyes to another way to do the thigs, and I agree 100%with you.
Thanks!!

 
Old December 1st, 2006, 07:42 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:When you refer to C# is the same for VB.NET, write?
yes, of course.

The question shouldn't be "where should the transaction be", but rather "how will I manage transactions - should it be .NET code on application server, or stored procedures in the DB".

And then you have to consider the long term and how big a given system is likely to get, and what kind of distributed transactions might be needed over time.

The only wrong choice is the one you arrive at quickly! This is an important subject that deserves some thought. This is not a "one size fits all" kind of thing.

Eric





Similar Threads
Thread Thread Starter Forum Replies Last Post
Transactions???? CRONER BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 February 4th, 2009 04:43 PM
Asynchronous Transactions jroxit Other Programming Languages 0 July 29th, 2008 11:12 AM
Chapter 8 - Transactions jamocle BOOK: Professional WCF Programming: .NET Dev with Windows Communication Found ISBN: 9780470089842 9 February 25th, 2008 10:05 AM
transactions.... Johnslg BOOK: Expert SQL Server 2005 Integration Services ISBN: 978-0-470-13411-5 0 August 20th, 2007 08:51 AM
Postgresql Transactions satyr Pro JSP 0 March 23rd, 2006 08:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.