SQLAlchemy events (see
http://docs.sqlalchemy.org/en/rel_0_9/core/event.html) are a
relatively advanced feature that allows you to hook in to various
operations that occur within the library. I think "history events" in
this context refers to "attribute events"
(http://docs.sqlalchemy.org/en/rel_0_9/orm/events.html#attribute-events).
Normally, when you set a property of a mapped class, an event is fired
saying that the property has been modifed. Another part of your
application could listen for this event, for example if you wanted to
write to an audit log or something like that.

If you aren't deliberately using these events yourself, then you
probably won't care very much whether or not those events are emitted
as part of session.merge()

Hope that helps,

Simon

On Thu, Jul 17, 2014 at 10:21 AM, Bao Niu <[email protected]> wrote:
> Probably what is abstruse here is the jargon "emitting history events", is
> it something as a newbie must understand in order to use Session properly?
> As a beginner should I know this before studying Session section? I'd
> appreciate some insight from pros. Thanks.
>
>
> On Tuesday, July 15, 2014 5:57:59 PM UTC-7, Bao Niu wrote:
>>
>> In the documentation for session.merge() method, there is a section on the
>> mechanism of reconciling if the load=true is set:
>>>
>>> If the load=True flag is left at its default, this copy process emits
>>> events and will load the target object’s unloaded collections for each
>>> attribute present on the source object, so that the incoming state can be
>>> reconciled against what’s present in the database. If load is passed as
>>> False, the incoming data is “stamped” directly without producing any
>>> history.
>>
>>
>> I don't quite understand the relationship between "stamped" and without
>> "stamped". The author is apparently trying to contrast something important
>> here, but I just couldn't imagine what a stamp could be here. Could someone
>> explain this process in a newbie-friendlier way please? Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to