Mike Gentrry -> I agree 10 is a small batch size, but I wanted to keep it
small to start to get a sense of if this was going to work. Given that it's
looking better and better that number is probably going to grow, maybe
substantially.
Lon - the problem is that the batch entries all fails together
Actually most (or all?) DBs that cayenne supports will do a batch bind for
multiple inserts, which is quite a bit faster than issuing separate sql
statements.
On Thu, Jun 24, 2021 at 10:14 AM Jurgen Doll wrote:
> I'm not sure about this, but I don't think Cayenne does SQL batch insert
> statemen
I'm not sure about this, but I don't think Cayenne does SQL batch insert
statements - it does each insert (even in a batch) as single SQL insert
statements. If this is the case then there's no real advantage, I think,
to doing batch commits with Cayenne in this particular case (or am I
mist
10 is a rather small batch size. I'd suggest at least 100, perhaps even
1000, unless you are expecting tons of problem records.
For your hashing concerns, could you maybe store that in an H2 DB you use
for this migration?
On Wed, Jun 23, 2021 at 12:54 PM Tony Giaccone wrote:
> Yeah, that's not
You could commit your batch of 10 and then on error, check each object
against the DB. If the batch succeeds, there is nothing special to do.
Assuming your "failure" batches are infrequent, then the time to check them
won't be an issue.
On Wed, Jun 23, 2021 at 9:54 AM Tony Giaccone wrote:
> Yea
Yeah, that's not a solution that's going to work. I need to move about a
million records from one database to a second, and the delay associated
with querying the database for every record would take a problem that's
already going to take more than a day to complete and turn it into several
days.
I think it would be better to figure out the "problem" objects before
committing by querying the DB and the object context.
On Wed, Jun 23, 2021 at 9:47 AM Tony Giaccone wrote:
> I have a list of 10 new objects that I've inserted into the objectcontex
> and am about to do a commit changes on the
I have a list of 10 new objects that I've inserted into the objectcontex
and am about to do a commit changes on the object context.
One, or more, of those entries violates a constraint and causes the commit
changes to throw an exception.
Now most of them are probably ok, so I want to make sure t