Felix Schwarz wrote:
> 
> Thank you very much for your reply - lightning fast as always :-)
> 
> Gaetan de Menten schrieb:
>> Other than that, maybe you are (or Turbogears is)
>> starting a transaction somewhere (with session.begin()) without ever
>> commiting it? 
> 
> Thanks for your hint. Indeed I used session.begin() after my session.flush()
> and obviously did not cause a COMMIT (why?) although there were objects to 
> save.

SA won't automatically commit a transaction you've begun.  You need to 
.commit() explicitly.  As Michael said, .commit() will flush changes in 
the session before committing, so you could switch to calling that.

It can be useful in a transaction to issue a simple .flush().  It 
updates the database with the Python-side changes queued up in the unit 
of work, and those updated rows are visible to subsequent queries within 
the transaction.  The changes won't be visible to other db users until 
(and if) the transaction is eventually committed.


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