well heres the code:

     def clear(self):
         """Remove all object instances from this Session.

         This is equivalent to calling ``expunge()`` for all objects in
         this Session.
         """

         for instance in self:
             self._unattach(instance)
         echo = self.uow.echo
         self.uow = unitofwork.UnitOfWork 
(weak_identity_map=self.weak_identity_map)
         self.uow.echo = echo

and heres the identity map accessor on session:

     identity_map = property(lambda s:s.uow.identity_map)

so, brand new underlying UnitOfWork, brand new dictionary.   Since i  
dont understand the case you are describing (how do you "select"  
items of class C from class A ? i dont understand what that means),  
you might want to attach a reproducible test case.


On Mar 7, 2007, at 9:01 AM, Mathieu Rouleau wrote:

>
> I currently have a setup of multiple table polymorphic inheritance
> which looks like A <- B <- C
>
> I insert items in C, then flush.
>
> If i select C items from A at that point everything is fine.
>
> But if i clear the session something odd happens, the session's
> identity map still has keys pointing to the instances I added before
> the flush but with some members now unititialized (specifically
> members of C).
>
> So when I then select C items from A i get the a list of C instances
> but with none of their members initialized, even though the actual
> select in the database yielded the correct values in the RowProxy.
>
> I'm using ActiveState Python 2.4 along with PySqlite and the latest
> SQLAlchemy egg.
>
> Thanks in advance,
> Mathieu Rouleau
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
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