The weird part is that I just checked my candidates table and I see no 
duplicates. 
However, during the generation of a report that ties candidates, jobs, and 
events, I get duplicate candidates.

On Tuesday, February 17, 2015 at 1:38:04 PM UTC-5, Jonathan Vanasco wrote:
>
> A serial would usually be an integer that is tied to a sequence (postgres, 
> oracle) or auto_increment (mysql).
>
> I see in your example that you have a unicode string -- `ORaE9+aCdP0`
>
> If that is coming from another db, then you've already migrated that 
> candidate.  
>
> you'll should do a search for that candidate by the id/primary_key first, 
> and only insert if they're not in the database.
>

I assume that I could create a getId() for candidate. However, how do I 
query for key the db and insert?
Thank you.
 

> you could also use nested transactions / savepoints to deal with expected 
> integrity errors -- but that can get messy.
>

I have already tried to use savepoints and nested transactions and I got 
even more errors. I rather stay away from complicated stuff. 
I have been reading the sql alchemy docs.

Thanks. 

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to