On Jan 30, 2009, at 12:38 PM, Alessandro Dentella wrote:

>
>> "connection already closed" is a psycopg2 error indicating that the
>> socket has been shut down.   looking at your output, I see a raw
>> execute() occuring within the string conversion of your Project  
>> object
>> and theres a module called sqlkit/db/utils.py causing an exception
>> throw.   SQLA's rollback then fails too but probably for the same
>> reason.  since you're executing directly off of the engine there, it
>> would seem unrelated to the state of the connection related to the
>> session.    its not apparent why the socket would be shut down,
>> however, unless the database were restarted perhaps.
>
> sorry for not seeing that error myself, on the other hand: no  
> postgres has
> never been shut down. Anyhow I got rid of that code (an on the fly  
> __str__
> builder), I go little further but get errors again.
>
>  1. prj is fetched from db by a session.query()   id=18
>  2. I try to delete it, failing due to constraints on the db
>  3. session.rollback()
>
>  4. print prj.name  -> error
>  4b. session.expunge_all()
>      session.flush()
>      fetch a new one (id=20) -->  error (reported below on id=18)
>
> So back to the question: in which state is 'prj' after failing  
> deletion and
> after rolling back?

its in the same state as that which it first got loaded, i.e. not  
marked as deleted.  all of its attributes are also expired.    the  
stack trace you posted doesn't make sense to me though, as its issuing  
a SELECT statement but PG is raising an exception for an UPDATE / 
DELETE ?  I've never seen that before.  If you can provide a self- 
contained test case which reproduces that behavior we can try it out.


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