Need to find a faster way to create many records

There are times in my application where I need to create on the order of thousands of new records.
The current workflow is to create objects by parsing a file that the user wishes to import. After creating the objects, I get a reference to my entity and use the AddNew() method. With a for loop I create the new record and fill in the fields from the objects.
I then display the new records in a datagrid. From here, the user can save to the database after reviewing the datagrid.
Parsing the file, instantiating the objects, and filling the datagrid are all extremely quick but the process of calling AddNew() and actually filling the record is very slow. 
It seems like I am very CPU limited. My first thought was to use multple threads to create the new records(aka AddNew(), not for saving) but I don't know of any way to do this since Lightswitch requires all access to be from the screen logic thread.
Is there a better way for me to do this?

I have a couple of thoughts for you:
I think that you will have to upload the file to the web server and load from there.  That will get you the most improvement in speed and that may be fast enough.
The next thing that you can do is to use a stored procedure to insert the records instead of Entity Framework via AddNew().  You could use Michael's code to insert records individually, which would be much faster than AddNew, or you could do a batch
insert for best performance.  If you are only inserting a thousand records or so, it won't make much difference.
See the following for what I have found to be the fastest insert method:
Inserting records using stored procedure with table-valued
parameter
Another user used this method and got the following results:
Got it to work in a small test program entering 19MLN records and the results are just fabulous:
vb.net record entry on the server -> 8 hours
stored procedure per records -> 30 minutes
stored procedures with table parameter -> 3 minutes
(That's 100,000 records per second).
Another thing that you might want to do is to first insert the records to a temp table; the user could then approve/reject records.  If they approve, run a stored proc to copy from the temp table to the final table.  (When I say temp table,
I don't mean a real SQL server temp table, but another table that is just used to hold the data while reviewing.)
Mark

Similar Messages

  • Help need to find $7.99 a month create pdf

    I need to buy an adobe program to create pdf file from word doc and quickbooks invoice.
    Your advisor told me to look up create pdf for $7.99 a month. cant find it.

    Hi,
    Create Pdf is now known as Pdf Pack . You can visit the below mentioned link for help:-
    https://www.acrobat.com/createpdf/en/home.html?promoid=KIIBF
    Thanks

  • Need to find out the number of Master data records transfered to the BW

    Hi,
    We need to find out the number of Master data (example -0MAT_PLANT_ATTR) records to be transfered to BW side. This is a delta extract.  We are preparing test scripts to check the master data extract ( full & delta) from ECC6 TO BI 7.0..
    Advance Thanks.

    Hi,
    Goto RSA3 and run that master data extractor in D mode if you want to know the number of records in delta and in F mode if you want to know the Full volume. But make sure that you set data records/calls and the display extr calls numbers so that you get the total number of records.
    The other option is goto the master data source table and look at the number of records in that table. That'll give you an idea of the total number of records in the table.
    One other option is to goto RSA7 , select the delta datasource and hit the display button. You'll get to know the number of entries in the delta queue that way as well.
    Cheers,
    Kedar

  • Need to find all Bugs and QF created for 8.0.0.13

    Hi all,
    I kneed to know how to find all bugs and possibly patches/QF created on top of 8.0.0.13 for bugs found in 8.0.0.13 after its release on Jan 2012. This is for my Customer that needs to know if they have to plan some QF in proactive way.
    I can access to Internal Support Portal, so if there is any place where Support people can go I can access.
    Thank you in advance
    Chiara Scarafiotti
    ACS TAM

    Hi radhika,,
    This the the way to go..just modify the col according to your table col names...
    You can do a CONNECT BY query without a START WITH clause to link every node with each of its ancestors.
    Getting the total is just a matter of GROUP BY.
    SELECT emp_id, employee_name, manager_id
    , CASE
              WHEN COUNT (*) = 1
              THEN 0
              ELSE COUNT (*)
         END               AS cnt0
    ,     COUNT (*)      AS cnt1
    FROM employee
    CONNECT BY emp_id     = PRIOR          manager_id
    GROUP BY emp_id, employee_name, manager_id
    ORDER BY emp_id;
    output:
    Output:
    . EMP_ID EMPLOYEE_N MANAGER_ID CNT0 CNT1
    1 Mark 0 5 5
    2 John 1 3 3
    3 Stella 1 0 1
    4 Karen 2 0 1
    5 Andrea 2 0 1
    I made this a bottom-up query (going from each node to its ancestors) rather that a top_down query (node to descendants) because you can't GROUP BY CONNECT_BY_ROOT.
    In your description you implied that each node would be counted among its own descendants, but in the sample output you had 0, not 1, as the count for all the leaves, that is, managers counted as their own descendants, but non-managers did not. The column called count0 in the query above does that; the column count1 counts each node as its own descendant, leaves included.
    Regards
    Onenessboy

  • Need to find out link between reservation created and actual issue of mater

    Hi
    I am going to develop a Y report for client, where they want to see the reservation details created in MB21 and the actual goods issue against the reservation (some more details also). Now from the table RESB I got the details of reservation and also know whether it is issued or not. But can not find the issue details like batch, issuing storage location those details entered in MB1B. can any body help me out how to link the reservation number to find out the actual issue?

    Hi,
    In MB51 you can find out the Reservation against the movement type and material documents. In your output screen reservation field is not find then you can set in the following ways.
    After execution of MB51:
    Goto Current Display Variant (Ctrl+F8) icon
    Click Position Tab
    Select Reservation in the Hidden field and send to Poistion
    Now you can findout the reservations against document number.
    Regards,
    BK

  • Need to find out a way to figure out how DB2 connect to Oracle and data mirroring etc.

    Hi, Gurus,
    I just take over a project which source is ICOMS as400 db2 database. Seems data mirro CDC is used to replicate from DB2 to oracle.
    I am very new to this datamirror CDC , plus I am new to figure out how db2 connect to oracle, is that through db link or what? or is there tnsnames entry?
    I would like anybody in this forum can point me to the right direction.
    Thanks in advance.

    user9233598, if mirroring/replication from DB2 to Oracle already exists then question is what product is being used?  If the product has already been purchased then I do not think it is very likely that management is going to want to purchase another product so I do not see how extra-cost Golden Gate or other Oracle Gateway features apply if those are not currently in use.  If Golden Gate or the Oracle Transparent Gateway are in use then you already have your answer
    Oracle supports ODBC/JODBC and the replication application on the AS400 likely uses these features or a thick Oracle client as the interface to Oracle.
    HTH -- Mark D Powell --

  • Best way to create detail records based on data in the master record..

    Hi,
    I am using 11gr1p1 and ADF stack.
    I have a master detail relation between 2 records. I have EO and entity associations. I want to create a number detail records based on the data on the master record.
    For example
    I have a Stay Record which has begin and end date I need to create the DailyStay Record for each day for the range of begin and end date of StayRecord.
    Where should I do this? In EO implementation or in VO implementation.?
    Thanks

    Where should I do this? In EO implementation or in VO implementation.?If your child record should in no case be created without those default values, then EO.
    Otherwise, to increase reusability of your EO, then in the VO over the view link (i.e. other VO's would still be able to use your EO without having the child VO created with these defaults).
    This way your ViewObjects can also be used in a context where you don't want to copy from the masterFrank, If there's another UI flow that is so drastically different that it does not want things defaulted, then it probably needs a different VO altogether (on the same underlying EO though)

  • Correct way of creating DNS record

    I want to create a DNS record for below
    Project.mumbai.contoso.com with IP 215.67.X.X
    I already have existing forward lookup zone created for contoso.com.
    Is it better to create a host record 'Project.Mumbai' with ip 215.67.X.X?
    or create one more forward lookup zone 'Project.Mumbai.Contosso.com' and cerate A record for 'Projec'?
    Mahi

    Hi Mahi,
    Are you asking if you should create "project.mumbai" in the contoso.com domain, or if you should create "project" in the mumbai.contoso.com domain?
    The choice depends on how you want to manage these records. If there will be a need to manage contoso.com and mumbai.contoso.com separately, then you should create two domains. You might have this need, for example, if the contoso.com domain is very
    large, or if you want to host mumbai.contoso.com on a different DNS server, or if mumbai.contoso.com corresponds to an Active Directory domain elsewhere.
    If none of these things are true, it will probably be easier to manage a single domain so you can just create contoso.com and add the host project.mumbai in this single domain.
    -Greg

  • Isn't there a faster way to download a recorded session?

    Hi - I am the Connect host for faculty at a university and need to download a series of one hour + recordings. Is there another option besides downloading in real time? Not to mention having to abandon my computer during the download. Thanks so much!

    Hi Suzanne,
    Welcome to the forums. At this time there is not a faster option for getting a video version of the recordings. This is due to the fact that Connect doesn't record the live sessions as a video, but instead keeps track of everything that happened and then recreates the live meeting experience when watching them from the server. The make offline option makes a local FLV recording of the meeting re-creation. There is an additional paid option for making MP4 versions, which doesn't happen any quicker, but is done through Amazon, so you just get access to the videos once the conversion has been completed. You can talk to your reseller about cost options for that.
    Jorma

  • Best way to create tasks and assign to sharepoint groups

    Hi everyone, I have a custom list which contains newsletter info that is to be seen by around 400 groups (they are stores) and then I need them to mark each list item as 'completed'
    I have been trying to figure out the best way to do this and decided to keep the custom list and somehow link it to a task for each item in the list. We have nintex so was thinking of creating a workflow to create a separate task for each group (store) so
    they can mark it as completed.
    Is this the best way to go about it or am I completely off track?
    Basically all I need is a list which contains around 30 items and around 400 groups (stores) which contain users (store staff) to be able to mark items on the list as completed so it recognises that each store has completed each task.
    Thanks

    Hi  ,
    According to your description, you want to find the best way for creating tasks for 30 list items and assigning the task to around 400 groups.
    For the workflow, it is heavy  that  you need to create around 12000 (30*400) tasks .  In my opinion, the best way is to do with a custom timer job. For more information, you can refer to the
    blog:
    http://www.splessons.com/2013/12/create-a-timer-job-in-sharepoint-2013/
    Thanks,
    Eric
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support,
    contact [email protected]
    Eric Tao
    TechNet Community Support

  • Is there a way of creating a filter by Activity ID if all the data is in Excel?

    Hello, I am a new user of P6 and I am trying to find a quick way of creating a filter by activity ID. I have a list of activity IDs that I need in an excel file but I am trying to see if there is a quicker way than typing up each ID in the filter. I am not able to block copy and paste from excel when using filters. Is it possible to import from excel to P6? Any advice would be much appreciated.

    Hold down the option key when you click the + button on the criteria. You can then set up Or conditions (Any).

  • What's the best way to include many files into a website?

    I have a several hundred documents that I would like to load onto my website. I'm trying to find a faster way than hyperlinking them all one by one. Right now they are in pdf format but that can change. I'm hoping for the end result to be one page (possibly with subpages) with the different links for the documents on them. The visitor doesn't necessarily need the ability to download them, just the ability to view them. Is there a faster way to bulk or batch load multiple files into a site? Thanks in advance.

    Getting PDFs to download is fairly easy and the method is described here.....
    http://www.iwebformusicians.com/WebMusic/PDFs.html
    To get multi page docs to display in the browser requires the use of Google Docs viewer, ISSUU or some such thing....
    http://www.iwebformusicians.com/PromoPage/ISSUU.html
    Safari is the only browser I know of that will display PDFs in an iFrame without a plugin.

  • Creating "A" record in Cisco 1841

    Hello All,
    We are using Cisco 1841 router. Our requirement is to configure "A" record in the router i.e. we wanted this router to act as a Primary DNS server.
    I can bit explain the scenario.
    We have connected Internet Lease line ILL to this router with a static ip assigned to it. We  have a domain name registered say e.g. www.xyz.com at www.namecheap.com. We wanted to host the web server inside our office network for our website. We did the necessary changes at www.namecheap.com to the domain www.xyz.com pointing it to our static ip. But we are not able to ping or browse the domain www.xyz.com and we contacted www.namecheap.com technical support and they informed us that we need to create a "A" record where ever the web server is hosted.
    I tried to search the internet and i couldn't able to find the necessary online resources for creating "A" record in the router for the domain name. But i could find the below link for creating soa record http://blog.ipspace.net/2006/09/use-your-cisco-router-as-primary-dns.html and created a namesever entries like ns1.xyz.com
    But this doesn't create "A" record
    Any assistance would be really helpful.
    Thanks
    Sundar

    Dear Daniele,
    Thanks for your reply.
    You solution worked great for me.
    We are able to ping the domain name.
    Now we are facing another problem in reaching our web server. I will explain it below.
    1. When i type the domain name in the browser we are getting a authentication popup asking for username & password, the popup says "a username and password are being requested by says level_15_access ..."
    2. I provided the router username & password it redirect to the following link http://www.sitename.com/archive/flash:home/html/home_aux.shtml. and load the SDM (Cisco router and security device manager) page.
    NOTE: we have installed Cisco SDM.
    What i wanted is, the site should reach our website hosted in our IIS server inside the network. The IIS server has an local IP address 192.168.1.x and the router gateway has a IP address 192.168.1.y
    Any assistance would be really helpful.
    Thanks
    Sundar

  • Creating multiple records

    When creating multiple records in a table using a SBO object eg invoice object, do you have to create a new business object for each record that is created?  There is a lot of overhead in doing this (eg each object takes about 1MB of mem so to create 1000 invoices would hog 1GB of mem).  Is there a way to create just one instance of the object and use it to create many records?  How is the object cleared in between each record creation?

    Greg,
    Everytime you call GetBusinessObject() you should, at the end, also release the acquired memory.
    This can be done with the following code in .net (C#):
    System.GC.Collect();
    System.GC.WaitForPendingFinalizers();
    Another way to clear all the data is to call the <b>GetByKey(-1)</b>; the document with docentry '-1' does never exists and the fields of the object are normally cleared.
    Regards,
    Jurgen

  • I need help finding a workable web program that is not CSS based.  I tried IWeb and it just won't work for me.  Way too limiting.  I've been using a 12 year old copy of Macromedia Dreamweaver, but the new Dreamweaver is CSS

    Been building web pages for nearly 20 years, starting with GoLive.  Went to Dreamweaver about 12 years ago, the Macromedia version.  Tried going to iWeb when it came with a new Mac, but found it way too limiting with it's CSS template base.   Unknowlingly, I then bought a new copy of Dreamweaver.   Ooops, Adobe had bought Macromedia and Dreamweaver, too, is now CSS based, which for my money makes it useless to anyone who likes simplicity.   Now I find that even iWeb has been discontinued.  I was told yesterday that Apple doesn't have a web program any more.   At 12 years old, I just don't think it's practical to try to load my old Macromedia Dreamweaver into the new Mountain Lion (I'm getting a new Mac), though it is running, barely, in Snow Leopard.
    I need to find a web builder program that will permit simple construction of educational pages, nothing fancy, nothing artistic, just create a page, give it a color, type or drag in text, insert a table, insert pix in the table blocks, add text under the pix... done!    I should note that I am not looking to build traffic.  I teach simple things for free and people who want to learn those things (antique sewing machine repair, quilting, building longbows) find me.
    I've downloaded trial versions of half a dozen or so programs and looked at maybe 20 more, but all are either CSS based and drive me insane with requirments for constantly making rules and template models, and/or require that you base your web presence in their server.   Also, many will not work with pages built in other programs.  I maintian a volume of over 1000 web pages, many requiring regular updating, and they have been with the same server for more than 15 years.  I'm not about to change.
    So, anybody know a simple, old fashioned web builder that's happpy on a Mac platform?
    Captain Dick

    Although not supported anymore, iWeb does still function using Mountain Lion...
    http://www.iwebformusicians.com/iWeb/mountain-lion.html
    ... and you can purchase it from Amazon.
    Start with a blank page using the Black or WHite template.
    All modern websites use CSS and there are thousands of free templates to be had if you want to use a code entry style application. You will need to go this route if you want to create a site that is viewable on mobile devices although you can create an iPhone version using iWeb...
    http://www.iwebformusicians.com/iWeb/Mobile-iWeb.html
    Search this forum for numerous topics about iWeb alternatives.

Maybe you are looking for

  • Game Center - How can you view friends of friends

    I read on another forum that it's possible for my friends on Game Center to view my other friends. But no indication as to how to do that, was mentioned. Does anyone know how to do this? Message was edited by: Char FL

  • Reformat external drive from mac os to windows

    the windows partition on my mac book pro is close to full. i would like to use an external drive formatted for windows for my growing number of pc games (gw,tdu,fsx,dirt - which run great on the mac book pro windows partition btw). i tried to reforma

  • How to set two icloud calender in Microsoft Outlook?

    Good day to all. For my experience when we install icloud on my PC(Win 7), that only allow one apple ID sync Outlook calender. Is that possible to set two apple ID for my Outlook Calender? Example:- [email protected]                            sync to

  • EAP-TLS and getting a new user to log in on a wireless network

    I have setup EAP-TLS using AP1232 + ACS + CA + Active Directory + some wireless client machines. Works fine. My issue is when I have a new user, who has never logged onto the client workstation. I know that if I attach the workstation to a wired netw

  • Scale factor in f.09

    i want to maintain the value of TOTAL OF REPORTING PERIOD in LACS. What Scaling factor to choose and how to set it as default.