Hi Michael,

As I tried to show in the pseudo-code, the INSERTS look like they're
happening during the query (in step 1), well after the save/commit. I
even tried to add a flush and, when I turn on echo mode, I see inserts
happening at the query step. Is this even possible?

Mark

On Oct 1, 11:49 am, Michael Bayer <[EMAIL PROTECTED]> wrote:
> On Oct 1, 2007, at 11:02 AM, [EMAIL PROTECTED] wrote:
>
>
>
>
>
> > Hi again, I really must be missing something fundamental here as I
> > cannot seem to solve this problem:
>
> > I have a loop that queries one table (without any contraints) and
> > writes to a second table (with constraints). Here's what the loop
> > looks like in pseudo-code:
>
> > while True:
> >   1) query old table and create a work list
> >   2) while items are in the work list:
> >   2.1) create a new object
> >   2.2) save
> >   3) commit
>
> > I can wrap the save (2.2) and commit (3) in try/except blocks which
> > solves the IntegrityError exceptions at that point. The problem is
> > that I'm getting IntegrityError exceptions in the query section (1)
> > what seem to be deferred INSERTS from the commit (3).
>
> > How can I turn off the deferred inserts?
>
> some sample code would be helpful here in order to get some context
> as to what youre doing.  if the problem is just that the INSERT's
> dont occur until you say session.commit(), you can issue session.flush
> () at any time which will flush all pending changes/new items to the
> database.


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to