Check this code out: http://python.pastebin.com/kMV611z7
In there I generate an object instance, add it to a session, then commit it. I then try and access the id attribute (autoincrementing PK), which results in SQL being emitted... but the emitted SQL has the id value in it already! Is there a reason for this? Is it just that it commit() expires all attributes, so *any* attribute access results in a refresh? I think I'm missing something in my understanding of this. The PK is clearly kept for the resulting query. And one more thing... In the same code you can see I'm trying to access an instance property after the instance has been added to a session, and the session has been closed. Is there any way to make the last-known attributes of an instance available after the previously associated ORM session is gone? I thought that expunging did this, but it seems not. Thanks, Russ -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@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.