Thanks Michael -- I had a feeling it was something simple eluding me. Calling Session.flush() worked perfect.
On Mon, May 16, 2011 at 4:26 PM, Michael Merickel <[email protected]>wrote: > 2) Return a newly committed object (for instance, if I save a new user >> successfully, I'd like to return that user object to the handler) > > > You can populate your user object's pkey same as always by issuing a > session.flush() after adding the object to your session. This will dump it > to the database, populate the pkey, and refresh the orm object. The data is > not persisted until you commit the session using transaction.commit() or > allowing pyramid_tm to issue the commit for you at the end of the request. > > This may passively answer your previous question, but maybe not. In general > if you're worried about integrity errors you can probably just issue a flush > (which executes the SQL in the db) and see if that works. > > One question I cannot answer, however, is how the transaction manager > interacts with nested transactions. Anyone have an answer for this? > > -- > You received this message because you are subscribed to the Google Groups > "pylons-discuss" 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/pylons-discuss?hl=en. > -- You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en.
