Sorry for my slowness, but I still have a minor problem understanding
"expired object". Why does it always assume that the database carries the
most recent and desired data so that the instances in memory are marked
expired? Can't an "expiration" mean the other way around, in which the
objects in memory are recent and the database is marked expired, so that
next attribute access would automatically cause an update on the database
according to the attributes on the objects currently in memory?
On Feb 23, 2014 9:16 AM, "Gunnlaugur Thor Briem" <gunnlau...@gmail.com>
wrote:

> It means that an object in memory (or some of its attributes),
> representing an entity in the DB, is no longer considered to reflect the
> state of that entity accurately because the entity may have changed in the
> DB. So next time attributes are read from the object, fresh DB state is
> queried. See
> http://docs.sqlalchemy.org/en/latest/orm/session.html#refreshing-expiring"To 
> clear out the currently loaded state on an instance, the instance or
> its individual attributes can be marked as "expired", which results in a
> reload to occur upon next access of any of the instance's attrbutes."
>
> Gulli
>
>
>
> On Sun, Feb 23, 2014 at 10:00 AM, Bao Niu <niuba...@gmail.com> wrote:
>
>> I read the documentation several times yet still didn't find an official
>> definition for "expired object", although it is used quite often. To my
>> understanding, it means when you update some attributes on a persistent
>> object, so those affected attributes that are still lying in database
>> become "expired". Is my understanding correct, please? Thanks very much.
>>
>> --
>> 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 sqlalchemy+unsubscr...@googlegroups.com.
>> To post to this group, send email to sqlalchemy@googlegroups.com.
>> Visit this group at http://groups.google.com/group/sqlalchemy.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "sqlalchemy" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sqlalchemy/tGGrkYX5tlE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to