On Feb 7, 2009, at 6:51 PM, cputter wrote:

> Query all users
>
> <User(2, Charls)>
> <User(1, John)>
>
> ##############################
>
> Which is really strange behaviour.  There's obviously something wrong
> in my implementation of HasTraitsORM but why the different results
> within the same loop???  Why add only two instances?
>
> Totally baffles me.

I know you've posted your code and full explaination, which I haven't  
taken the time to get into as of yet.   The whole  
InstrumentationManager thing was created to support PJE's Trellis  
library, and it hasn't been used in any other scenario that i'm aware  
of - for that reason, as well as its very embedded level within the  
code, its going to be a hard road to travel.

But for the question above, the debugging path is the same as for a  
very simple application - what SQL is being emitted and what results  
are being returned by the database ?   At the very least you can  
isolate the problem to the persistence or the query side.      As you  
add things to the session, peek inside to see that its state is as  
expected (i.e. new, dirty, obj in session, etc).  Also try not  
commiting/closing the session on every object - it should work either  
way of course but if the difference is indicated by that change,  
that's a clue as well.


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