#10792 closed defect (invalid)
Possible update failure due to autocommit
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | database backend | Version: | 0.12.3 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
One failed autocommit defect in trac/cache.py. This defect happens when I migrate trac into MySQL NDB Engine environment.
Code sample start from line 186 in trac/cache.py:
def do_invalidate(db): cursor = db.cursor() cursor.execute(""" UPDATE cache SET generation=generation+1 WHERE id=%s """, (id,)) cursor.execute("SELECT generation FROM cache WHERE id=%s", (id,)) if not cursor.fetchone(): cursor.execute("INSERT INTO cache VALUES (%s, %s)", (id, 0))
I tried open autocommit mode in NDB engine, still update operation is not commited before select. Even defaulty mysqldb disabled autocommit.http://mysql-python.sourceforge.net/FAQ.html
Is it suitable to add explicitly cursor.commit() between update and select ?
Attachments (0)
Change History (2)
comment:2 by , 12 years ago
Milestone: | 0.12.4 |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Fine. Thanks for the feedback!
You may want to provide additional feedback concerning the NDB limits in #8567.
invalid, I figure out it is not problem of commit. still NDB varchar limit problem, please close this.