Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #926 (closed defect: duplicate)

Opened 13 years ago

Last modified 12 years ago

Problem using destroySelf with sqlobject.dburi="sqlite://..."

Reported by: anonymous Owned by: anonymous
Priority: normal Milestone:
Component: SQLObject Version: 0.9a6
Severity: normal Keywords:
Cc:

Description

This is related to ticket #763. When using sqlobject.dburi="sqlite:///file_name_and_path", I not only see the error reported in ticket 763 but I also find that destroySelf() fails with an OperationalError?:

2006-06-01 12:38:44,964 cherrypy.msg INFO HTTP: Page handler: <bound method GroupAPIController.newFunction of <contact.controllers.group.GroupAPIController object at 0x203ddf0>>
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 105, in _run
    self.main()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 254, in main
    body = page_handler(*virtual_path, **self.params)
  File "<string>", line 3, in newFunction
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/controllers.py", line 273, in expose
    output = database.run_with_transaction(
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/database.py", line 221, in run_with_transaction
    retval = func(*args, **kw)
  File "<string>", line 5, in _expose
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/controllers.py", line 290, in <lambda>
    mapping, fragment, *args, **kw)))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/controllers.py", line 314, in _execute_func
    output = errorhandling.try_call(func, *args, **kw)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/errorhandling.py", line 71, in try_call
    return func(self, *args, **kw)
  File "/Volumes/Litter Box/Users/stodd/Documents/Contracts/Cont@ct/Projects/contact/contact/controllers/group.py", line 35, in newFunction
    result = fn(self, *args, **vargs)
  File "/Volumes/Litter Box/Users/stodd/Documents/Contracts/Cont@ct/Projects/contact/contact/controllers/group.py", line 224, in delete
    theGroup.destroySelf()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1675-py2.4.egg/sqlobject/main.py", line 1462, in destroySelf
    self._connection._SO_delete(self)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1675-py2.4.egg/sqlobject/dbconnection.py", line 777, in _SO_delete
    return self._dbConnection._SO_delete(inst)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1675-py2.4.egg/sqlobject/dbconnection.py", line 594, in _SO_delete
    self.query("DELETE FROM %s WHERE %s = %s" %
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1675-py2.4.egg/sqlobject/dbconnection.py", line 305, in query
    return self._runWithConnection(self._query, s)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1675-py2.4.egg/sqlobject/dbconnection.py", line 219, in _runWithConnection
    val = meth(conn, *args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1675-py2.4.egg/sqlobject/dbconnection.py", line 302, in _query
    self._executeRetry(conn, conn.cursor(), s)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1675-py2.4.egg/sqlobject/dbconnection.py", line 297, in _executeRetry
    return cursor.execute(query)
OperationalError: database is locked

BTW, I am the only user accessing the file. The workaround posted with #763 to use notrans_sqlite to turn off transactions also corrected this problem as well.

This problem showed up when I upgraded to 0.9a5 to 0.9a6. (Mac OS X 10.4.6)

Change History

comment:1 Changed 13 years ago by jorge.vargas

  • Status changed from new to closed
  • Resolution set to duplicate
  • Component changed from CherryPy to SQLObject

I'm close this as dup since the destroy is failing due to the first problem, please post a comment on #763

Note: See TracTickets for help on using tickets.