Michael Bayer wrote: > Rodney Haynie wrote: > >> I am having problems getting my data to save when the changes are made >> through stored procedures. >> I created a sample block of code below to show exactly how I am >> implementing this. >> >> <code> >> conn = DBSession.connection() >> statement = sql.text("""CALL insert_test(321, 1);""") >> results = conn.execute(statement).fetchall() >> # The result set will have the new primary key value. >> if results == []: >> return None >> >> newID = results[0][0] >> transaction.commit() >> return newID >> </code> >> > > what is "transaction" here ? it seems to be ephemeral. > > I failed to say this is a TG2 app. There is the transaction module I import > at the top of the controller file. >
import transaction I was trying different things, and I believe I don't need the code "transaction.commit()". But I was grasping at straws. Is there any way I can tell that the automatic transaction sees changes? -R > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---