yeah, ive just added a unit test for this and a small improvement as well.
 the steps to reproduce the bug look like this:

        m = mapper(User, users,
properties={'addresses':relation(mapper(Address, addresses))})
        m2 = m.options(lazyload('addresses'))
        u = m2.selectfirst(users.c.user_id==8)
        objectstore.refresh(u)

the important thing happening there is, a second mapper and second
"addresses" property is being created, which has the effect of a 
CallableProp being placed on the local attribute of "u" which is blowing
up during the refresh() operation.   now it wont blow up, nor will it fire
off the lazy loader in the middle of the refresh().  Also CallableProp is
called "TriggeredAttribute" in the code now.


Gambit wrote:
> Thanks Michael - this was in revision 1234, I'll check out the latest
> this evening.
> --G
>
> At 00:33 02/04/2006, Michael Bayer wrote:
>>gambit -
>>
>>you have a lazyloader on an object that is failing to clear properly,
>>its a bug.   try out the latest trunk, since i was just changing that
>>stuff around today, it might fix the problem.  or just go add an
>>empty clear() method onto the CallableProp class in attributes.py.
>>
>>On Apr 1, 2006, at 1:30 PM, Gambit wrote:
>>
>>>Hi guys -
>>>
>>>I'm working on a hard-to-trace down AttributeError thrown when I
>>>try to objectstore.refresh() one of my central objects.  I've
>>>created a trial test case, which sadly _does_not_fail_, but at
>>>least demonstrates my usage.  I'm looking for angles to approach
>>>this problem from; sadly the object I'm trying to refresh isn't
>>>portable, nor does it lend itself towards simplification.
>>>
>>>In short (and English), after updating one of my secondary
>>>instances that has a foreignkey relationship with my customer
>>>instance, I commit the objectstore (which happens successfully),
>>>and then refresh the customer.  With full echoing turned on I see
>>>the update occur, and the select get issued for the refresh.  It is
>>>immediately after the SELECT that the error occurs, at line 414 of
>>>attributes.py in reset_history.
>>>
>>>I tried haphazardly throwing refresh(cust) calls at various places,
>>>but was only able to evoke the error by refreshing the object after
>>>the commit().
>>>
>>>Any ideas?
>>>--G
>>><refresh_check.py>
>>><attribute_error_traceback.log>
>>><refresh_check.log>
>
>
>
> -------------------------------------------------------
> 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
>



-------------------------------------------------------
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

Reply via email to