Re: Commit Exception

2018-09-28 Thread Tony Giaccone
This answer is probably way off topic for this group as it's not really Cayenne related. But I want to give some closure to the solution so that anyone else who ends up reading this can see the totality of the problem and solution. My original through was, I don't have to test for uniqueness becau

Re: Commit Exception

2018-09-28 Thread Bob Schellink
Would be nice if Cayenne could pinpoint the problematic record, but I think that will depend on what error info the database provides. Thinking of a strategy to get speed and correctness, how about an optimistic strategy: Process a batch of 500 records and if commit fails only then process that b

Re: Commit Exception

2018-09-28 Thread John Huss
That's a database error, not an ORM thing. And it's database specific. And all the database gives you is the error string. So you HAVE to parse it if that's what you want. The less hacky approach would be to detect the prevent the duplicate key error upfront with custom logic. On Fri, Sep 28, 2018

Re: Commit Exception

2018-09-28 Thread Tony Giaccone
Yeah, that's pretty much what I ended up doing. Even reading the file line by line and doing an insert after each object is created only made the run time go to 4 minutes and I can live with that. What I really wanted to do was find a way to recover from a larger commit. It seems that's not really