Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Component Services / October 2005

Tip: Looking for answers? Try searching our database.

Design Question on Transaction Management

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jakk - 22 Sep 2005 07:23 GMT
We have a situation when after user submits the page the data goes to 5
different stored procedures which are executed one after the other and
all these stored procedures should be in a one single transaction. My
question is where should I start the transactions, In the Business
Layer or in the DataAccess Layer. I was actually planning on creating a
method in DAL which calls the 5 methods which in turn call the 5 procs
and put this method in transaction using COM+. I dunno if this is a
good approach or should the transactions be handled in the Business
Layer. Is there any design pattern on this?? Does any one have any
sample code that I can use as a reference to handle transactions in
Business layer??

Thanks
Jak
Florin Lazar [MSFT] - 02 Oct 2005 07:46 GMT
Jak,

I don't know what is your definition for Business and DataAccess layers. If
I assume that your business layer is a layer between your client (web app)
and the DataAccess layer, then I can try to give an answer. The transaction
should be started at the level/layer where you needed. I.e. if in your
Business layer you have a method that calls two methods in the DataAccess
layer, and the actions of these methods should be transactional (all or
none) then you should start the transaction in the Business layer. If the
Business layer method only calls a method in DataAccess layer, which in turn
does 5 calls to the underlying database, then you should start the
transaction at the DataAccess level; no need to add the overhead of the
transaction flowing from the business layer to the dataAccess layer in this
case. I hope this answers your question.

Regards,
Signature

Florin Lazar - Microsoft - [ http://blogs.msdn.com/florinlazar ]
<Enjoy transactional programming with System.Transactions!>
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.

We have a situation when after user submits the page the data goes to 5
different stored procedures which are executed one after the other and
all these stored procedures should be in a one single transaction. My
question is where should I start the transactions, In the Business
Layer or in the DataAccess Layer. I was actually planning on creating a
method in DAL which calls the 5 methods which in turn call the 5 procs
and put this method in transaction using COM+. I dunno if this is a
good approach or should the transactions be handled in the Business
Layer. Is there any design pattern on this?? Does any one have any
sample code that I can use as a reference to handle transactions in
Business layer??

Thanks
Jak

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.