Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6784599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:00:51+00:00 2026-05-26T17:00:51+00:00

We are using 3 layered architechture which contains SqlHelper -> DAL(Data access layer) ->

  • 0

We are using 3 layered architechture which contains
SqlHelper -> DAL(Data access layer) -> BAL -> UI

Any class within a DAL can call another DAL same way any BAL can call another BAL or DAL of its own.

eg.

class Customer_DAL { display_CusDal(); }
class Customer_BAL { display_CusBal(); }   

class Product_DAL { display_ProDal(); }
class Product_BAL { display_ProBal(); }


display_CusDal()
{
 //call display_ProDal()
 //Do some work
}

display_CusDal function should run as a transaction which intern means any insertion made within this function should be associated with transaction object.

Since display_CusDal can call display_ProDal which might or might not be inserting data in table in another transaction, so I need to handle these in transactions.

What approach should I use.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:00:52+00:00Added an answer on May 26, 2026 at 5:00 pm

    SqlTransactions only work with SQL and require you to add usage of them explicitly. The advantage of the TransactionScope is that more parties can join the transaction. So not only SqlTransactions, but also transactions from other types. Also a lot of code is taken away when using the transaction scope.

    On the other hand, using transaction scope can introduce quite some wierd behavior. Stuff gets escalated to MSDTC in vague situations.

    For your situation the transaction scope sounds like the best option. Via this way it is very easy to join multiple actions executed on the Customer_DAL and Product_DAL, or multiple actions on the same DAL, in a single transaction.

    Pro’s for SqlTransactions

    • Easy to understand.
    • Explicit
    • You have total control.

    Con’s for SqlTransaction

    • Requires more code.
    • Harder to join with more parties.
    • Harder to join with other transactions.
    • Binds your transactions to SQL (so no support when switching to other durable storage)

    Pro’s for TransactionScope

    • Easy to use.
    • Keeps your code simple, you don’t need to worry about Customer_DAL and Product_DAL mixing.
    • Great transaction management out of the box. Including escalation to MSDTC when multiple databases are used.

    Con’s for TransactionScope

    • Vague when escalation happens.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a project using a layered architecture. I have a DAL in which
I have a layered application in Java which has a multi thread data access
I'm building a 4 layered ASP.Net web application. The layers are: Data Layer Entity
In a layered architecture, you have a presentation layer, logic layer and data layer.
Where should resource files go and at what granularity (application/assembly/namespace/class/...)? Using a layered architecture
I am building a small website for fun/learning using a fairly standard Web/Service/Data Access
My team is building our first significant Silverlight application, using a 3 layered architecture
I'm looking after a way to AlphaBlend a child form, if possible using layered
Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.