#926: Problem using destroySelf with sqlobject.dburi="sqlite://..."
-----------------------+----------------------------------------------------
 Reporter:  anonymous  |       Owner:  anonymous
     Type:  defect     |      Status:  new      
 Priority:  normal     |   Milestone:           
Component:  CherryPy   |     Version:  0.9a6    
 Severity:  normal     |    Keywords:           
-----------------------+----------------------------------------------------
 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/[EMAIL 
PROTECTED]/Projects/contact/contact/controllers/group.py",
 line 35, in newFunction
     result = fn(self, *args, **vargs)
   File "/Volumes/Litter
 Box/Users/stodd/Documents/Contracts/[EMAIL 
PROTECTED]/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)

-- 
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/926>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Tickets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-tickets
-~----------~----~----~----~------~----~------~--~---

Reply via email to