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

  • Home
  • SEARCH
  • 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 103597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:08:56+00:00 2026-05-11T01:08:56+00:00

Application 1 – Opens a SqlConnection and a SqlTransaction against a SQLServer 2005 database

  • 0

Application 1 –

  • Opens a SqlConnection and a SqlTransaction against a SQLServer 2005 database
  • Inserts a record into Table1
  • Does not commit or roll-back the SqlTransaction – intentially keeping this alive to demonstrate / describe the problem

Application 2 –

  • Opens SqlConnection and a SqlTransaction against a SqlServer 2005 database
  • Tries to run this query – ‘SELECT COUNT(Id) FROM Table1’

Table1 – Id is an Identity field. Name is a varchar field. No other fields in the table

Application 2 is unable to run the ‘SELECT …’ query. It seems that Table1 is locked or blocked by the insert done in Application 1.

Though the scenario mentioned above is fictional – it demonstrates the problem that we are facing adequately. We want to be able to open a long running SqlTransaction (maybe hours) and do many inserts/updates via that SqlTransaction.

We are developing a data conversion application which has to do a lot of processing on a lot of data before it could be inserted/updated into the database. The data conversion is to happen while we have our main WebForms based application running against the same SQLServer 2005 database in which we want to perform the long running transaction.

All the tables in our application are segmented by a ClientID field from a ClientMaster table. For example if we have a CollegeMaster table, then it would have a ClientID field as a part of the primary key and a ID field for its own identification. The data conversion starts by creating a new ClientID and that new ClientID field is used in all other tables.

Ideally all queries like the one mentioned in Application 2 should not be affected by the long running transaction. Those queries should only read / use data that is already commited and continue to work rather than get blocked due to the long running transaction. What can Application 1 do to ensure that this is achieved?

  • 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. 2026-05-11T01:08:57+00:00Added an answer on May 11, 2026 at 1:08 am

    You may want to look into this Sql 2005 feature. Sounds like it may help you. Its a newer locking mechanism you have to enable in the DB, but apparently has much less blocking.

    http://msdn.microsoft.com/en-us/library/ms177404(SQL.90).aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 119k
  • Answers 119k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Lock documentation: Note that Lock instances are just normal objects… May 11, 2026 at 11:46 pm
  • Editorial Team
    Editorial Team added an answer You likely want to take a look at AutoResetEvent and… May 11, 2026 at 11:46 pm
  • Editorial Team
    Editorial Team added an answer You shouldn't have to use the new operator if you… May 11, 2026 at 11:45 pm

Related Questions

Application 1 - Opens a SqlConnection and a SqlTransaction against a SQLServer 2005 database
I need to add functionality to my J2EE-based wep application: 1) Take some page,
We are about to upgrade a C# windows application (1.1) to WPF from windows
My company finally bought a code-signing certificate. I have a WinForms application (1 exe
I'm having so many problems getting more than 1 MVC project up and running

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.