On Feb 26, 2009, at 10:27 AM, Wichert Akkerman wrote:
>
> Previously Michael Bayer wrote:
>> On Feb 26, 2009, at 8:21 AM, Wichert Akkerman wrote:
>>> What happens if you do not call expunge on it, but pickle the object
>>> in a
>>> cache, load it later and then merge it?
>>
>> the state of the newly unpickled object, that is the current value of
>> its mapped attributes, would be merged with the persistent version in
>> the session. merge() will load the object from the database into an
>> in-session, persistent instance before merging the external state.
>> because your unpickled instance never actually enters the session,
>> conflicts with its previous session or an already present in-session
>> object are nicely avoided.
>
> I actually skip that and invalidate the cache entry on changes to
> prevent that SQL hit. What I meant was: does it matter if you never
> explicitly call expunge?
for pickling ? not at all.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---