Re: [SQLObject] Bug: InheritableSQLObject can leave DB in inconsistent state
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: David T. <no...@op...> - 2006-12-11 19:47:19
|
On Mon, 2006-12-11 at 22:24 +0300, Oleg Broytmann wrote: > On Mon, Dec 11, 2006 at 02:17:20PM -0500, David Turner wrote: > > 1. Wait to create the row in base until just before the row in derived > > is to be created. > > > > 2. (maybe) use transactions. > > We cannot wait because we need an id from the parent table to insert a > new row to the child table with the same id. Transactions are the only > answer, I think. There's a bit of a tricky thing about transactions: we need to make sure that the calculation of default values for the derived row takes place outside (but simultaneous with) the transaction, because anything inside the transaction can see the new row in the base table. |