-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Insert rows into the database in parallel? #12057
Replies: 1 comment · 4 replies
-
hi You can create multiple new units of work to solve problems. https://docs.abp.io/en/abp/latest/Unit-Of-Work#begin-a-new-unit-of-work |
Beta Was this translation helpful? Give feedback.
All reactions
-
@maliming thank you for your response. There is a code requesting data from API. Then I want to insert the data in parallel (simplified code snippet below). All of the code there is already in the UoW. I tried your advice and I got the exception, it's below after the code.
Exception:
|
Beta Was this translation helpful? Give feedback.
All reactions
-
|
Beta Was this translation helpful? Give feedback.
All reactions
-
4.2.0 Sorry for missing the version :) |
Beta Was this translation helpful? Give feedback.
All reactions
-
hi Can you share a project that uses the template project(local SQLLocaldb)? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi folks,
In one scenario, we need to insert thousands of records into the database in parallel to do it faster. As known, DbContext doesn't support multithreading. To create several DbContexts, we'd like to use DbContextFactory (maybe with pooling). However, I can't find how to do it correctly in the documentation. Is it possible? Or maybe there are other approaches to insert rows in the database in parallel?
Thank you in advance for the answers.
Beta Was this translation helpful? Give feedback.
All reactions