I agree, but the thing is that committing every 10 entries is a little
low for me, I was thinking of around 50, at which case having 50
individual commits is quite costly..
In case I choose the implement your method, how would you go about it?
How do you keep objects of the last 50 or whatever records from the
last commits that have not been committed yet (taking into account my
recursion)?

Thanks again!

On Apr 20, 12:17 pm, Richard Harding <rhard...@mitechie.com> wrote:
> Not that I'm aware of. When you do a Session.add() it's not touching the
> database yet. It's part of the performance tradeoff. There's not a good way
> for it to *know* there's a record in the db with that pk id until it does
> chat with the db on it. Sure, you can keep a list of ids on the side if you
> want, but it just seems that you're going to have a try: except block there
> anyway in case of other issues, db connection fails, bad values, etc, that
> you might as well just catch the exception for a row already existing as
> well.
>
> Rick

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to