Bulk record Insert in Database

Topics: Administration, Core, Customizing Orchard, Jobs, Writing modules
Feb 1, 2013 at 6:10 AM
i have created a module for upload .csv file and the file records are going to insert into the table name "DeviceRecords", this file will have a huge records its around 50000, my problem is orchard does not support BulkCopy method, but i tried _orchardService.ContentManager.Flush(); _orchardService.ContentManager.Clear(); after 100 records to be inserted but the datas are inserted in un order wise. hence i want to know about how to insert bulk record into database. if its possible with orchard it would be more helpfull
Feb 10, 2013 at 9:39 PM
The main problem of bulk operations like these is that they will by default happen in a single transaction. If you look at the import code, you'll see what I mean. One thing you can do is break the work down into smaller batches and schedule each.