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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:38:33+00:00 2026-05-20T01:38:33+00:00

I need to upadte, add and delete rows from the auth.models.User table, unfortunately… when

  • 0

I need to upadte, add and delete rows from the auth.models.User table, unfortunately…

when I do so the table locks and I cannot perform any SELECT queries against the table.


I’m surrounding these queries by @transaction.commit_manually, which might have something to do with the tables locking.

The transaction look like the following:

for row in csv_reader:

    update_sql = "UPDATE auth_user SET last_name = '%s' WHERE username = '%s'" %(row[2], row[0] )
    cursor.execute(update_sql)
    if not index % 100: print index:
        print index
        transaction.commit()

Also I’m using Sql Server 2008, I would like to know if it’s Sql Server specific or such actions would lock the table in PostgreSQL and MySQL too.


Any ideas guys? 🙂

  • 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-20T01:38:33+00:00Added an answer on May 20, 2026 at 1:38 am

    Yes, you lock the tables on purpose. I would suggest studying transaction isolation because it is one of the core concepts of databases.

    As for your problem, you could do several things, for both the UPDATE and the SELECT statements:

    • You could SET the transaction isolation level to something lower for the rest of the database connection.
    • You could probably do the same with other mechanisms too.
    • You could try to rearrange your queries so that you first read base data, and after that start modifying data. This might allow you to lock the table but allow the operation to proceed.
    • You could consider again what queries are important to be handled transactionally.
    • You could also guide the SQL Server with Locking Hints.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table of about a million rows and I need to update
I need to update a lot of rows, per a user request. It is
I have richfaces page thru which i have to add/update/delete a user details. My
I need to update the comments field in a table for a large list
I need write an update statement that used multiple tables to determine which rows
I need to do a lot of processing on a table that has 26+
Hi I have a site where I use a User Table. I want to
I need third party applications (Foo) to get information from my application (Bar), but
I am wondering, are there any languages allows you to add/delete/update any class on
I need to update a combobox with a new value so it changes the

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.