hi mike,
Michael Bayer wrote:
> hi Kapil -
>
> are you wanting to have multiple copies of history in
> prophistory/historyarraylist ? right now its just "saved version" /
> "new version".
yup, basically on a savepoint operation, it would take a copy.
>
> attribute rollback itself is a pretty sketchy ordeal, since it ignores
> other object state that might depend on those attributes, bypasses any
> setter/getter logic that might be on the object, gets a lot more
> unpredictable with backrefs involved, has nothing to say about objects
> being created or deleted from memory, etc. the attribute "rollback"
> function is only there as a side effect of having to keep track of whats
> changed/whats been removed. a few people have played with it anyway and
> they immediately write to me on the mailing list about how its broken
> and all the problems theyre having with it...which I definitely do not
> want since its beyond what i think is fundamentally important about
> SA...a real "rollback" solution would have to be some kind of native
> "memory map" that can manipulate the local namespace at some magical/low
> level...and at that point we're getting really far from writing SQL and
> doing some kind of in-memory version control system.
>
ouch, i'll consider myself forewarned. the generic case posed by an
arbitrary sa system might be difficult, but if the existing rollback
machinery works, it should amount to the same. hmm.. although i hadn't
really considered how rollback of newly created objects and deleted
objects would work, i need to do some more research into how sa
currently handles this with a regular transaction abort, and the issues
raised previously on the mailing list.
basically on a savepoint, the objectstore would do a slightly modified
commit, that would in addition visit the attribute manager to invoke a
snapshot on modified values and map to the savepoint name. on rollback,
it would restore to the mapped value, on commit its a non issue. hmmm..
i guess in memory references to deleted objects would need to be
restored and removed for added objects during a rollback.
> however, if you think you have some way to make it better, or to make it
> work in a way that is more intuitively predictable, im not opposed to
> more elaborate attribute/rollback functionality. But if the attribute
> system plus a set of "savepoint" functionality its going to complicate
> the core or add any kind of latency/overhead to attribute access, it
> might be nice if it was "pluggable" functionality....i.e. when imported,
> replaces objectstore.global_attributes with a different AttributeManager
> and adds some "savepoint" function somewhere. since it seems like a
> special-need function and it would be nice if there were a whole bunch
> of "special-need"-oriented modules that were only used upon explicit
> import (like the declarative layer is). id like to keep the default
> "core" fast and light.
>
understood. their really shouldn't be any additional overhead outside of
doing the savepoint and savepoint rollback operations and the memory
associated with a savepoint and the saved attributes. but it might not
be for everyone, and basically my use cases for sa at the moment, all
involve dynamically generated sa models from an existing application
model, so i'm not as concerned with custom setters/getters. i'll work on
it as a separate module for now.
cheers,
kapil
> - mike
>
> On Mar 7, 2006, at 1:24 AM, Kapil Thangavelu wrote:
>
>> hi folks,
>>
>> one of the things i'm interested in doing, is supporting savepoints
>> for supported databases that support such ( postgres, oracle,
>> firebird). i'd like to do to do this without clearing the objectstore
>> identity map on a savepoint rollback. in order to go about this i'd
>> like to modify prophistory, to be able to map a savepoint name to an
>> index in the attribute history to allow for savepoint rollback and
>> have the mapping cleared on commit or abort along with corresponding
>> implementation in the engine and objectstore
>>
>> would such functionality be welcome in sa?
>>
>> cheers,
>>
>> kapil
>>
>
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users