I hope you get this working, though I have to strongly second Mark's
statement about not using Transfer for this scenario.  Iterative loads
scale poorly as the quantity of records goes up.  Bulk loading of
records should take place in the underlying DBMS if at all possible.
If you need to create extra child records in your process, I am sure
that could be handled in a small number of queries after the initial
data load.


On Jul 13, 7:55 pm, John Watson <[email protected]> wrote:
> transfer.xml excerpt:
> <object name="invoice" table="tblInvoices">
>   <id name="invoiceId" type="numeric" />
>   <property name="invoiceNum" type="numeric" />
>   <property name="invoiceDate" type="date" />
>   <onetomany name="invoiceItem" lazy="true" proxied="true">
>     <link to="invoiceItem" column="fk_invoiceId" />
>     <collection type="array" />
>   </onetomany>
> </object>
> <object name="invoiceItem" table="tblInvoiceItems">
>   <id name="invoiceItemId" type="numeric" />
>   <property name="itemDesc" type="string" />
>   <property name="itemCost" type="numeric" />
> </object>
>
> I'm then looping through a CSV file that contains a line of
> "invoiceNum,invoiceDate,itemDesc,itemCost"
>
> read-in-csv
> loop-start
>   attempt to get invoice object
>   if not persisted
>    set invoiceDate
>    save invoice object
>   end if
>
>   new invoiceItem object
>   set itemDesc
>   set itemCost
>   set parentInvoice to invoice
>   save invoiceItem
> loop-end
>
> For ~500 invoiceItems, this does not complete in under 15 minutes.
>
> If I however, remove the o2m relationship in the invoice object and
> add the fk_invoiceId as a property to invoiceItem, it takes only a
> couple minutes.
--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

You received this message because you are subscribed to the Google Groups 
"transfer-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to