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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:32:52+00:00 2026-05-24T23:32:52+00:00

I have a batch of ‘robots’ that runs around reading RSS threads and stores

  • 0

I have a batch of ‘robots’ that runs around reading RSS threads and stores the results in a database, and I parallelized it so that many feeds can be fetched at once:

Parallel.ForEach(context.Feeds, feed => ProcessRssFeed(feed, context));
context.SubmitChanges();

The ‘ProcessRssFeed’ function can insert records into the context as they are found, and each feed could be anywhere from zero to hundreds of items. There are a lot of feeds, so I did not want to create a LINQ DataContext for each.

I’m worried, though, that I could be accumulating thousands upon thousands of records on the client. I suppose I could run out of memory.

Since there’s no concurrency issue here if it were possible I’d like to tell the DataContext “go ahead and submit records periodically if you like”. Is there some practical way to achieve this?

  • 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-24T23:32:52+00:00Added an answer on May 24, 2026 at 11:32 pm

    I would recommend creating a new DataContext for each. The DataContexts are quite light weight compared to the actual database connection. The DataContext uses connection pooling when connecting to the database, you don’t get much overhead by using separate DataContexts.

    Keep only the stuff that need to be submitted atomically in a DataContext, submit that and create a new DataContext for the next item.

    There is no built in method for periodically submit, but you can watch the number of items in DataContext.GetChangeSet() and submit when that count is over a given threshold. But you should only do that if profiling shows that creating new DataContexts is really a bottleneck in your system.

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

Sidebar

Related Questions

We have a batch job that runs every day and copies a file to
I have a batch file that was created for an Oracle database that I'm
I have a batch file that runs an SSIS job. I have no knowledge
I have a batch file that runs ant and then copies one of the
I have a batch file that runs some SELECT queries using sqlcmd, puts the
I have a batch file that executes a .sql file to backup a database.
I have a batch file that runs a richcopy program, I am wanting to
I have this batch that needs to run that the user has to execute
I have a batch file that installs WinVNC in about 1 second and starts
I have a batch file that is running inside CruiseControl and outputing either Pass

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.