I can not recreate the problem in a standalone program for now.

I think it might have something to do with events from attribute extension.

If I change the weak_identity_map to false the problem does not happen.

I might be doing something in one of the callback from attribute extension
set method that is causes the problem.


Michael Bayer wrote:
> Attached is a script that attempts to imitate as close as I can tell  
> to what you are asking (and the end result is correct).   Modify it to  
> illustrate your exact issue.
> 
> 
> > 
> 
> 
> ------------------------------------------------------------------------
> 
> 
> 
> 
> On Sep 27, 2008, at 1:52 PM, Mike Bernson wrote:
> 
>> I have a problem with row coming back form mapped class that has  
>> relations.
>>
>> The session is created with:
>>
>> self.session = Session(bind=self._engine, autoflush=False,
>>           _enable_transaction_accounting=False, autocommit=True,
>>           weak_identity_map=True)
>>
>>
>> The problem occurs with instance on that have already been loaded  
>> and the query
>> ask for lazyload of some of the relations.  The first query load a  
>> bunch of row. The
>> second query does  the follow:
>>
>> query = session.query(mapped_class)
>> query = query.with_lockmode('update')
>> query = query.options(lazyload(relation1)
>> query = query.options(lazyload(relation2)
>> query = query.filter_by(id=234)
>> query = query.populate_existing()
>>
>> rows = query.all()
>>
>> In the rows relation1 and relation2 both are not none. All the data  
>> in relation1 and relation2 is
>> None. If I remove the lazyload and try it I get data in relation1  
>> and relation2.
>>
>> What I am trying to do is  update the instance to match the data and  
>> create locks for
>> all but the tables that are lazyload.
>>
>> There are no other references to relation1 and relation2.
>>
>> I have not verified but It look like if a relation has other  
>> references the relation has data in it
>> columns.
>> This happens in both 0.5b3 and 0.5rc1.
>>
>>
>>
>>
>> --~--~---------~--~----~------------~-------~--~----~
>> 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 [EMAIL PROTECTED]
>> For more options, visit this group at 
>> http://groups.google.com/group/sqlalchemy?hl=en
>> -~----------~----~----~----~------~----~------~--~---
>>
> 

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to