Print Page | Close Window

Question on saving records

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=4618
Printed Date: 12-May-2026 at 8:28pm


Topic: Question on saving records
Posted By: BillG
Subject: Question on saving records
Date Posted: 02-Dec-2013 at 10:58am
I have a coroutine where one of the parts of it loops through a collection and for each record in the collection (ex. member) creates a new entity of type (payment). There could be anywhere from several hundred to several thousand records that have to be created. As each payment row is created should I save it one at a time to the database or add it to the current entity manager cache and save the whole cache at once?



Replies:
Posted By: kimj
Date Posted: 02-Dec-2013 at 11:24am
If you need everything in a single transaction, then you'll have to save all changes at one time.  I assume you're worried about performance when saving several thousand entities at once - it should be doable, although you might need to modify some timeouts. 
 
Saving individually would work too.  DF2010 supports partial save, so that's one option.  Another is to use a separate EM for each save.



Print Page | Close Window