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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:18:07+00:00 2026-05-20T17:18:07+00:00

here is some insert code gkInfo.data.ToList() .ForEach(p => p.hour.ToList() .ForEach(r => r.block.ToList() .ForEach(q =>

  • 0

here is some insert code

gkInfo.data.ToList()
           .ForEach(p => p.hour.ToList()
                .ForEach(r => r.block.ToList()
                        .ForEach(q =>
                        {
                            var v = new VarValues();
                            v.dt = DateTime.Parse(p.target_date + " " + (r.value - 1).ToString() + ":00:00");
                            v.id_objecttype = config.stations.Where(i => i.text == q.station_name).Single().id_objecttype;
                            v.id_object = q.bnum.ToString();
                            v.id_param = config.stations.Where(i => i.text == q.station_name).Single().id_param;
                            v.pl_lev = 3;
                            v.source = 0;
                            v.value = q.block_state;
                            v.version = version;
                            v.description = q.change_type;
                            m53500context1.VarValues.InsertOnSubmit(v);
                        }

        )));


            m53500context1.SubmitChanges();

and this code, locks table.
can i avoid it? or its impossible?

  • 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-20T17:18:07+00:00Added an answer on May 20, 2026 at 5:18 pm

    Although I don’t know all the details regarding your issue the patterns seems very familiar. Often times you need to do a big update in the database, but at the same time you still need the database be available, so for example if there is a web site that is working off the dataset, it does not time-out while update operations in progress.

    Sometimes update operations can be regular exports from another database, sometimes, calculating some caches, not unlike the example you have provided.

    If you need your update be transactional (i.e. all or nothing), there is no real way around the lock. While the update is underway the table is locked. If you don’t need transaction, then you can try and break up you update to smaller batches. SubmitChanges, wrap all the changes in a single transaction, so you gonna need to use several SubmitChanges, so each individual transaction is fast and thus not locking the table for long.

    If being transactional is a requirement, you can do you inserts in a staging area, i.e. not in the same table that other processes read from. When the insert is finished you figure out the way, to swap the areas. This could complicated by the fact that there maybe updates into this table that you haven’t accounted for, but I do not know if this is true in your case.

    In the worst case you will need to have some application logic, that knows that update is in progress and while it’s happening it reads the data from an alternate location. Of course you will have to provide this alternate location (a copy) to read from.

    There is no hard and fast answer, but there a few things (above) that you can try. Also feel free to tell more about your specific task / requirements.

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

Sidebar

Related Questions

Here's some example code: $sql = INSERT INTO Users (Firstname,Surname) VALUES ('$firstname', '$surname'); $stmt
I'm trying to insert some data into a table with shell_exec (on localhost). Here's
here is myproblem, i want to make a php function to insert some random
Why does the titlebar overlap the pixels of JPanel. Here some code: protected void
Here is some sample Python code: import re some_regex = re.compile(r\s+1\s+) result = some_regex.search(
Here is some simple code: DIR* pd = opendir(xxxx); struct dirent *cur; while (cur
Here's some code (full program follows later in the question): template <typename T> T
Here is some code: class Person def initialize(age) @age = age end def age
I was using spring jdbc template to insert some data into the database and
Here's the thing, I don't have access to code that inserts data into a

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.