[Seaside] transaction engines?
Avi Bryant
avi at beta4.com
Thu Apr 29 01:14:40 CEST 2004
On Apr 28, 2004, at 4:44 PM, goran.krampe at bluefish.se wrote:
> radoslav hodnicak <rh at 4096.sk> wrote:
>> Does anybody happen to know/have an engine that implements
>> transactions
>> for normal smalltalk objects? No external access or anything needed.
>
> Stephen Pair has made one called KATS:
> http://map1.squeakfoundation.org/sm/packagebyname/kats
The thing I don't like about KATS is that it's too ambitious: it tries
to have the exact same instances of objects appear to have different
state inside different transactions. This means hacking the compiler
so that inst var accesses are actually lookups in the current
transaction, which is pretty intrusive. In Seaside, I don't expect to
share instances between sessions, and so having multiple copies of the
same object (one per transaction) would be perfectly fine. These could
be brought in as-needed the same way an OODB does - when accessing an
object for the first time in a new transaction, all of its references
would be stubbed out, and local copies for those objects would be made
the first time you tried to send them a message. Even with nested
transactions this would be pretty easy to manage, and a lot easier to
debug. Each transaction would keep a map from the original parent
object to the local copy, for use when committing. If you really
needed an instance that lived longer than a single transaction, you
could have a proxy that stored a root object and always forwarded its
DNUs to the local equivalent in the current transaction - basically the
same as the ReusableRef that Cees has mentioned using with OmniBase.
I've wanted to write a transaction engine like that for a while (I'm
tired of writing half-assed equivalents that break on edge cases, eg,
WAModelProxy), but haven't had time yet. Rado, if you get started I'll
pitch in.
Avi
More information about the Seaside
mailing list