In all seriousness - I wouldn't use Transfer for batch/bulk data import
operations, I would just use straight SQL.

The fact that there is a cache there means it gets really, really, really
full as you insert new objects every time.

That being said - I have seen people do this, but just discard the imported
object after they are done, and it has worked reasonably well, if time is
not a concern.

Mark

On Tue, Jul 14, 2009 at 10:55 AM, 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.
> >
>


-- 
E: [email protected]
T: http://www.twitter.com/neurotic
W: www.compoundtheory.com

--~--~---------~--~----~------------~-------~--~----~
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