12 messages in com.googlegroups.sqlalchemy[sqlalchemy] Re: ConcurrentModificati...| From | Sent On | Attachments |
|---|---|---|
| Arun Kumar PG | 30 Jul 2007 05:13 | |
| Michael Bayer | 30 Jul 2007 07:04 | |
| Arun Kumar PG | 31 Jul 2007 00:40 | |
| jason kirtland | 31 Jul 2007 01:19 | |
| Arun Kumar PG | 31 Jul 2007 01:36 | |
| Arun Kumar PG | 31 Jul 2007 01:47 | |
| King Simon-NFHD78 | 31 Jul 2007 01:57 | |
| Arun Kumar PG | 31 Jul 2007 02:13 | |
| Michael Bayer | 31 Jul 2007 07:37 | |
| Arun Kumar PG | 31 Jul 2007 07:47 | |
| Michael Bayer | 31 Jul 2007 08:03 | |
| Arun Kumar PG | 31 Jul 2007 08:32 |
| Subject: | [sqlalchemy] Re: ConcurrentModificationError: Updated rowcount 0 does not match number of objects updated 1![]() |
|---|---|
| From: | King Simon-NFHD78 (simo...@motorola.com) |
| Date: | 07/31/2007 01:57:14 AM |
| List: | com.googlegroups.sqlalchemy |
databases/mysql.py has this snippet in create_connect_args (0.3.10):
# FOUND_ROWS must be set in CLIENT_FLAGS for to enable # supports_sane_rowcount. client_flag = opts.get('client_flag', 0) if self.dbapi is not None: try: import MySQLdb.constants.CLIENT as CLIENT_FLAGS client_flag |= CLIENT_FLAGS.FOUND_ROWS except: pass opts['client_flag'] = client_flag
So CLIENT.FOUND_ROWS is a constant that should be passed as part of the 'client_flag' options to MySQLdb's connect method. I don't know you didn't need this before though.
Hope that helps,
Simon
________________________________
From: sqla...@googlegroups.com [mailto:sqla...@googlegroups.com] On Behalf Of Arun Kumar PG Sent: 31 July 2007 09:47 To: sqla...@googlegroups.com Subject: [sqlalchemy] Re: ConcurrentModificationError: Updated rowcount 0 does not match number of objects updated 1
The MySQLdb library has CLIENT.FOUND_ROWS = 2. What value ideally it should have ?
I am still now clear why this problem was not coming in the earlier SA version!
On 7/31/07, Arun Kumar PG <arun...@gmail.com> wrote:
I am using pool.QueuePool for managing connections and this pool is fed with a creator function which returns an instance of my own custom DBAPI class (I need this because of some logging stuff that I am doing). This custom DBAPI class returns a Connection object returned by MySQLdb.connect.
>>> The FOUND_ROWS client flag must be enabled on MySQL connections to make rowcount return what you (and SA) are expecting.
This has been enabled recently on SA 3.9 ? because the previous version was working fine.
On 7/31/07, jason kirtland < je...@discorporate.us <mailto:je...@discorporate.us> > wrote:
Arun Kumar PG wrote: > Looks like the problem is coming because of the fact when we are > updating a row in table with the same data the rowcount returned by > mysql is 0. Only when there is a change in data the rowcount is returned.
Are you creating connections outside of SQLAlchemy? (I seem to recall you were using a custom creator function.) The FOUND_ROWS client flag must be enabled on MySQL connections to make rowcount return what you (and SA) are expecting.
-- Cheers,
- A
-- Cheers,
- A
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---




