Modify

Opened 15 years ago

Closed 14 years ago

#5245 closed defect (fixed)

rollback function not working with sqlite

Reported by: anonymous Owned by: Ryan J Ollos
Priority: normal Component: VotePlugin
Severity: normal Keywords: rollback sqlite3 sqlite
Cc: jjbig, Thijs Triemstra Trac Release: 0.11

Description

what I did:

root@mail:~# easy_install http://trac-hacks.org/svn/voteplugin/0.11

<added line "tracvote.* = enabled" to config

root@mail:~# trac-admin <DIR> upgrade Traceback (most recent call last):

File "/usr/bin/trac-admin", line 8, in <module>

load_entry_point('Trac==0.11.4', 'console_scripts', 'trac-admin')()

File "/usr/lib/python2.5/site-packages/Trac-0.11.4-py2.5.egg/trac/admin/console.py", line 1317, in run

return admin.onecmd(command)

File "/usr/lib/python2.5/site-packages/Trac-0.11.4-py2.5.egg/trac/admin/console.py", line 133, in onecmd

rv = cmd.Cmd.onecmd(self, line) or 0

File "/usr/lib/python2.5/cmd.py", line 219, in onecmd

return func(arg)

File "/usr/lib/python2.5/site-packages/Trac-0.11.4-py2.5.egg/trac/admin/console.py", line 1149, in do_upgrade

if not self.env.needs_upgrade():

File "/usr/lib/python2.5/site-packages/Trac-0.11.4-py2.5.egg/trac/env.py", line 430, in needs_upgrade

if participant.environment_needs_upgrade(db):

File "build/bdist.linux-i686/egg/tracvote/init.py", line 142, in environment_needs_upgrade File "/usr/lib/python2.5/site-packages/Trac-0.11.4-py2.5.egg/trac/db/util.py", line 36, in getattr

return getattr(self.cursor, name)

AttributeError: 'PyFormatCursor' object has no attribute 'rollback'

root@mail:~# sqlite3 -version 3.4.2

Trac 0.11.4

Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2

Attachments (0)

Change History (6)

comment:1 Changed 15 years ago by fabien

Hello,

I get the same error...

comment:2 Changed 15 years ago by fabien

Ok... I guess it should be db.rollback() and not cursor.rollback()

With that modification, it looks ok...

comment:3 Changed 15 years ago by Thijs Triemstra

Cc: Thijs Triemstra added

Yep, that fixes it:

  • tracvote/__init__.py

     
    139139            cursor.fetchone()
    140140            return False
    141141        except:
    142             cursor.rollback()
     142            db.rollback()
    143143            return True
    144144
    145145    def upgrade_environment(self, db):

comment:4 Changed 15 years ago by anonymous

This change seems to be missing form the latest commit (6352). This was needed to install with the latest 0.11 release of Trac.

Axton

comment:5 Changed 14 years ago by Ryan J Ollos

Owner: changed from Alec Thomas to Ryan J Ollos

Reassigning ticket to new maintainer.

comment:6 Changed 14 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

Latest 0.11 version has cursor.connection.rollback(). Looks like this issue has been resolved. If you encounter the issue again, please reopen.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.