InheritableSQLObject: Data corruption when child record create fails
2009-12-07 16:41:54 GMT
Hi all,
I am doing some tests with InheritableSQLobject and have run into a problem
which I hope to get some feedback on.
The problem is that when creating a new object based on an
InheritableSQLObject class, and the creation of the child object fails after
a new parent was created, the parent record will remain in the database
without the relevant child.
Here is a short example:
~~~~~~~~~~ file: inheritTest3.py ~~~~~~~~~~~~
from sqlobject import *
from sqlobject.inheritance import InheritableSQLObject
__connection__ = "sqlite:/:memory:"
class Vehicle(InheritableSQLObject):
vid = StringCol(notNone=True, default=None, unique=True)
wheels = IntCol()
class Bicycle(Vehicle):
seats = IntCol(notNone=True, default=None)
class Car(Vehicle):
doors = IntCol(notNone=True, default=None)
def createTables():
Vehicle.createTable()
(Continue reading)

The stable version in Debian Lenny seems to
be formencode 1.0.1, but updating to 1.2 seems to have fixed the problem.
Thanks very much.
Cheers,
Tom
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.



RSS Feed