imgrey wrote:
> 
> Based on my observations it happens only with concurent inserts/
> updates.
> One thread :
> 
> {{{
> f_table.insert().execute()
> session.flush()
> transaction = session.begin()
> nested = session.begin_nested()
> try:
>   f_table.insert().execute()
> except IntegrityError:
>   #record is exists and we got exception corresponding to contraint
>   stuff = session.query(Path).select_from(..)
>   ..update..
> nested.commit()
> 
> transaction.commit()
> session.clear()
> }}}
> 
> Another thread:
> {{{
> f_table.delete(...)
> #or update
> }}}
> 

I'm probably completely wrong about this, but in your example above, I
don't think the statement f_table.insert().execute() necessarily uses
the same connection as the ORM-level transaction and queries.

Using SQL expressions with ORM transactions is covered in this section
of the docs:

http://www.sqlalchemy.org/docs/04/session.html#unitofwork_sql

Hope that helps,

Simon

--~--~---------~--~----~------------~-------~--~----~
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