Bugs item #1592786, was opened at 2006-11-08 17:20
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1592786&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: SQLite
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Jayhem (jayhem)
Assigned to: Nobody/Anonymous (nobody)
Summary: so-sqlite data corruption during updates
Initial Comment:
I'm hitting a bug when using SO with turbogears 1.1b
with an sqlite database. When I do several successive
updates to a table (which are very slow btw), data gets
corrupted in the interface, select() returns invalid
objects, as if objects were pulled from a cache that
was out of synch with the db.
>From this point, successive select() without any
updates in-between can return different values,
randomly selecting one of the previsouly set values.
I have created a simple test-case (on turbogears)
Just launch it and change some values. Usually after
10-20 changes, the corruption appears.
I have tried this same testcase with MySQL and do not
hit this problem.
Note that dev.cfg declares
sqlobject.dburi="notrans_sqlite:///..."
file: model.py
======================================================
from sqlobject import *
from turbogears.database import PackageHub
hub = PackageHub("bug")
__connection__ = hub
class Item(SQLObject):
data = UnicodeCol(length=40)
def loaddb():
hub.begin()
Item.dropTable(ifExists=True, cascade=True)
hub.commit()
Item.createTable(ifNotExists=True)
for i in range(20):
Item(data = str(i))
hub.commit()
loaddb()
file: controllers.py
======================================================
import turbogears
from turbogears.controllers import RootController, expose
from model import Item
class Root(RootController):
@expose(template="bug.templates.index")
def index(self):
items = Item.select()
return dict(items = items)
@expose(template="bug.templates.index")
def change(self, id):
item = Item.get(id)
item.data += str(id)
items = Item.select()
return dict(items = items)
file: index.kid
======================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://purl.org/kid/ns#"
py:extends="'master.kid'">
<head>
<meta content="text/html; charset=UTF-8"
http-equiv="content-type"
py:replace="''"/>
<title>Items</title>
</head>
<body>
<ul py:for="i in items">
<li>${i.data} <a
href="/change/${i.id}">[edit]</a></li>
</ul>
</body>
</html>
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1592786&group_id=74338
|