When looking for the session status I've
session.is_active == True
When checking the log file I don't have 'commit ' between working and
failing code. I don't know if it's normal but I've a strange behaviour
with session.query().get()
For the same Class and Id, If I call X times session.query.get() in
one case SA issue an SQL query for each call and in an other case SA
issue an SQL query only on the first call....
I've the feeling that my problem come from the session and maybe the
way it's initialized. I continue to investigate....


On 6 août, 16:38, "Michael Bayer" <mike...@zzzcomputing.com> wrote:
> sagblmi wrote:
>
> > I don't know if it's relevant with my prob but my application ends
> > with the following errors
> > Exception exceptions.AttributeError: "'NoneType' object has no
> > attribute 'from_attribute'" in <bound method
> > MutableAttrInstanceState._cleanup of
> > <sqlalchemy.orm.state.MutableAttrInstanceState object at 0xd7bce6c>>
> > ignored
>
> that seems like some messiness on garbage collection teardown.   its
> related to the usage of PickleType with mutable=True.  we might need to
> add some more defense to _cleanup to guard against those but they are
> harmless.
>
>
>
> >> I can't figure how that occurs but I'm facing to a stange ?bug?.  (I
> >> try to write a testcase but without success)
>
> >> After a call to session.query(MClass).get(id), the returned object has
> >> all these attributes marked as unloaded!!!!
> >> If I do a session.refresh(myObject), attributes are correctly
> >> initialized...
>
> if you do this:
>
> someobject = session.query(SomeClass).filter(...).first()
>
> # ...do stuff with the session
> session.commit()
>
> # now the session is expired, due to expire_on_commit.
>
> x = session.query(SomeClass).get(someobject.id)
>
> # x is pulled from cache and is expired !
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to