36 messages in com.googlegroups.sqlalchemy[sqlalchemy] Re: concurent modification| From | Sent On | Attachments |
|---|---|---|
| imgrey | 22 Nov 2007 11:28 | |
| Sanjay | 22 Nov 2007 23:43 | |
| imgrey | 23 Nov 2007 00:58 | |
| Michael Bayer | 23 Nov 2007 08:03 | |
| imgrey | 27 Nov 2007 11:39 | |
| King Simon-NFHD78 | 28 Nov 2007 01:33 | |
| Michael Bayer | 28 Nov 2007 07:20 | |
| imgrey | 28 Nov 2007 07:38 | |
| Michael Bayer | 28 Nov 2007 08:37 | |
| imgrey | 28 Nov 2007 09:03 | |
| Michael Bayer | 28 Nov 2007 10:40 | |
| imgrey | 28 Nov 2007 12:29 | |
| Michael Bayer | 28 Nov 2007 14:07 | |
| imgrey | 30 Nov 2007 06:36 | |
| Michael Bayer | 30 Nov 2007 07:15 | |
| imgrey | 30 Nov 2007 10:44 | |
| Michael Bayer | 30 Nov 2007 11:06 | |
| imgrey | 30 Nov 2007 12:06 | |
| Michael Bayer | 30 Nov 2007 13:13 | |
| imgrey | 30 Nov 2007 15:21 | |
| Michael Bayer | 30 Nov 2007 22:01 | |
| imgrey | 01 Dec 2007 16:24 | |
| Michael Bayer | 01 Dec 2007 16:37 | |
| Michael Bayer | 02 Dec 2007 10:22 | |
| imgrey | 03 Dec 2007 15:32 | |
| Michael Bayer | 03 Dec 2007 16:50 | |
| imgrey | 06 Dec 2007 05:57 | |
| Michael Bayer | 06 Dec 2007 08:50 | |
| imgrey | 10 Dec 2007 16:45 | |
| imgrey | 11 Dec 2007 13:43 | |
| Michael Bayer | 11 Dec 2007 13:55 | |
| imgrey | 11 Dec 2007 14:53 | |
| Michael Bayer | 11 Dec 2007 15:14 | |
| imgrey | 14 Dec 2007 18:24 | |
| Michael Bayer | 14 Dec 2007 20:01 | |
| imgrey | 20 Dec 2007 23:35 |
| Subject: | [sqlalchemy] Re: concurent modification![]() |
|---|---|
| From: | King Simon-NFHD78 (simo...@motorola.com) |
| Date: | 11/28/2007 01:33:06 AM |
| List: | com.googlegroups.sqlalchemy |
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 sqla...@googlegroups.com
To unsubscribe from this group, send email to
sqla...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---




