Re: BulkLoad with Composite Primary Key
Posted by: Joseph Lawler
Date: June 30, 2020 05:16PM

I got it to work. To be honest, not sure what changed. Too many tools being used.

I'm using native MySqlBulkLoader to load the table from CSV (Simple LoadAsync).
- I changed the class definition for the table to put the keys up front. That automatically re-arranged the columns in the infeed file to reflect the Composite Key (put them up front in correct order).
- I verified that the Primary Key(s) were first in the table in MySQL
Seems it should have worked. But nope it didn't.

Here's where I think something was wrong: I'm using Entity Framework for many of the simple queries. Out of laziness, I am also using EF to actually create the table (recreated before every load test). I looked there.

It started working once I also changed the EF modelBuilder definition for the table so that the modelBuilder columns reflected the Primary Composite Keys were listed first.

I've since reset the ModelBuilder definition (primary key columns no longer up front) and the data still loads. The table layout is the same either way (reflects the class definition).

Nothing else changed from before.

Oh well.
Thanks for offering to help!

Options: ReplyQuote


Subject
Written By
Posted
Re: BulkLoad with Composite Primary Key
June 30, 2020 05:16PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.