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 5938737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:43:41+00:00 2026-05-22T15:43:41+00:00

We are talking Isolation Level here, namely concurrency in relation to an Express MSSQL

  • 0

We are talking Isolation Level here, namely concurrency in relation to an Express MSSQL server running locally.

I’m trying to figure out a way to start the data-lockout when a user decides to edit a row in a GridView -> keep the data locked until he/she’s stopped editing (I.E. pressed ‘Update’).

As a list of events it looks like this:

  1. User 1 presses Edit on row with ID of 1.
  2. DataSet(row) is locked while User 1 is typing in new data.
  3. In case of a User 2 trying to Edit same row, that user should be noticed before even entering edit-mode on that row.
  4. User 1 updates the row, and edit-mode stops, therefor the data should be committed and the transaction closed.

I’ve started to make a few methods.

Prior to the methods, my service method always holds the connection in a private/local variable:

private SqlConnection connection = new SqlConnection("Data Source=host\\SQLEXPRESS;Initial Catalog=tablename;User ID=sa;Password=password");

Then there’s the methods.

public SqlTransaction BeginTransaction() {
    //Something like this
    SqlTransaction transaction = connection.BeginTransaction(IsolationLevel.ReadCommitted);
    return transaction;
}

public bool UpdateTidsregistrering(some parameters to be parsed from GUI) {
    using(connection) {
        connection.Open();
        SqlCommand command = connection.CreateCommand();
        //Execute a query here with a try-catch around like normally...
    }
}

public void CloseTransaction() {
    //Close transaction and connection?
}

My big question is: is this possible to utilize properly?

  • 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-22T15:43:41+00:00Added an answer on May 22, 2026 at 3:43 pm

    Scenarios to be considerate of…
    – Someone starts editting a row, then goes home for the evening
    – Many different users holding open transactions of many different rows
    – Network connection drops while user is editting
    – User A refreshes screen, User B modifies and commits a row, User A starts modifying the row, oblivious to User B’s change
    – Cost of holding multiple open transactions on many rows
    – Cost of all users having to have permantently open connections

    In general, my preference is to Only use TRANSACTIONS around code without any pauses. Especially pauses created any human interaction.

    My preferrred model for this scenario is to use a ‘last-modified’ time-stamp.

    1. Refresh data on screen, holding a last_modified_time for each row
    2. User clicks on a row
    3. App checks if that row’s last_modified_time has changed
    4. If changed, update the row from the DB and inform the user of the current state
    5. Allow the user to modify the row on screen
    6. User clicks “commit”
    7. Another check to see if the last_modified_time has changed
    8. If so, show different values and ask user if they still want to commit Their change
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my situation (SQL Server): I have a web application that utilizes nHibernate for
I'm talking about wrappers for third-party libraries. Until recently I was trying to provide
We are talking to a remote server for authenticating a user. The web server
When designing a database to use MVCC (Multi-Version Concurrency Control), you create tables with
I'm looking for a structured approach to long-running (hours or more) transactions. As mentioned
we have written a C# 3.5 client talking to an Oracle database (11g) using
When SQL Server Books online says that "Shared (S) locks on a resource are
How can I query the read/write ratio in Sql Server 2005? Are there any
The project I am working on were are trying to come up with a
I was talking to a guy and he says he likes his site with

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.