Edgewall Software
Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#10792 closed defect (invalid)

Possible update failure due to autocommit

Reported by: V.E.O@… 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)

in reply to:  description comment:1 by anonymous, 12 years ago

invalid, I figure out it is not problem of commit. still NDB varchar limit problem, please close this.

Last edited 12 years ago by Christian Boos (previous) (diff)

comment:2 by Christian Boos, 12 years ago

Milestone: 0.12.4
Resolution: invalid
Status: newclosed

Fine. Thanks for the feedback!

You may want to provide additional feedback concerning the NDB limits in #8567.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.