Michael Bayer wrote:

>>Hey, I just set my code to instantiate the session, and I get the
>>following error when I delete a client (which has a bunch of cascading
>>"all, delete-orphan" rules).
>>
>>   session = Session()
>>
>>NB: I've mapped the session.delete function to my "model" object for
>>convenience: model.delete = session.delete
> 
> that would be a likely suspect.  code works without that ?  send a  
> test case along if not.

Just to make sure, I made it very straight forward, calling the delete() 
method off the session directly and it still crashes. When the 
session.delete(client) is called, it fires all the SELECT queries that 
depend on the client's life (I also tried cutting off all depedencies). 
Once all the SELECTs are fired, I get the error:

InvalidRequestError: Instance '<mp.model.clients.Client object at 
0x18fd9d0>' is not attached or pending within this session

I don't understand why. This only happend when the session is instantiated.

So I prepared a test case in a single file, but it works in both cases. 
My problem is in my Pylons app, and I suspect that the dispersed modules 
doing imports are making some trouble (session instantiated in a module, 
then imported in another one). I'm not sure though, my code doesn't look 
that hacky... :/

Regards,
-- 
Alex


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