Determining the Better Approach of Transaction in n-tier Application Model and where Transactions ar

  • Thread starter msnews.microsoft.com
  • Start date
M

msnews.microsoft.com

Hello,

I have the scenario. I m building an application either in asp.net or window application. This application is base on n-tier application model.
Let us take example of Northwind Database in SQL SERVER.
i build an asp.net page. On that page i place the grid with one template column. In that column i put HTML Table with two rows. In First row there are one combobox and two textboxes. In the second row there is another DataGrid means Inner DataGrid. I select the data from the database and bind it with page. the data is shown in my required formate. When i click on the edit button then that row comes into edit mode. At that time i insert some rows in ther inner datagrid and delete some rows and update some rows. Then i click on update button. At behind i design the 3-tier application model. Now i update my database. The changes i made must be in a transaction.

for example the tables are Order, OrderDetail in Northwind Database
The Outer DataGrid show the data from Order Table (eg, columns shown are OrderID,CustomerName,CompanyName)
The Inner DataGrid show the data from OrderDetail on the basis of OrderID from the Order Table.

I have two classes in business layer
one is BusinessLayer.Order, second is BusinessLayer.OrderDetail

At DAL there are some methods which insert, update, and delete the records.
there are two classes OrderDAL and OrderDetailDAL.

from Page i call the update() method of BusinessLayer.Order Class.
This method call the Update() method of OrderDAL, and second call is Update() of BusinessLayer.OrderDetail class
The Update() method of BusinessLayer.OrderDetail call the Update() method of OrderDetailDAL.

My Problem is i want to do all this things in one transaction. How Can I do that?
The second question is Where i start the transaction (I think In business layer bcoz i call all methods here).
Then next Question is What is the better approach of Transaction in this scenario, I mean to ask whether .Net Transaction is Better or MTS DTC (COM+) Transaction
If Some One Answers that Manual transaction (.Net Transaction) is better. Then please explain how can i make that Business Layer Method to maintain a transaction.
I m not using Business Layer CRUD Behaviour.

Thanks

Muhammad Jamil Nawaz
 
S

Scott Allen

Hi Muhammad:

In general I'd only recommend using MSDTC if your transactions need to
be distributed across multiple servers, otherwise it only adds
complications and overhead to what can be a simple transaction you
start in your business layer.
 
B

Brock Allen

I'd suggest reading Tim Ewald's "Transactional COM+". Even though COM+ is
in the title, his book is still very approproate on design of transactional
systems in .NET.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top