Mendix entity to entity copy aata

0
I want to copy 50 lakes of row from one entity to another entity. How do I do that? 
asked
1 answers
0

I assume you need to copy 5 million records (lakh = 100.000). Two options:

  1. Batch processing
    Retrieve the records in small batches of few thousand (offset, limit) and create new objects with the values per iteration. Best to use a list where you add uncommited new objects and commit the complete list per batch.
    If you do it in one transaction, it is very possible you run out of memory. In that case every batch should be run in a separate transaction (use execution actions from community commons module).
  2. Use SQL with JDBC in Java and let the database do the work.
    This option will not give memory problems and will be lightning fast in relation to microflows and all the hurdle of Object Relational Mapping.
answered