On 6/29/07, voltron <[EMAIL PROTECTED]> wrote: > > I´m not sure if I should ask this here or the Pylons forum:
Here, but I haven't introduced SAContext here yet. SAContext is a little top-level organizer for engines, metadatas, and a session context. It was written for Pylons due to the confusion people were having setting up their models, but the SAContext class itself can be used in any SQLAlchemy application. http://sluggo.scrapping.cc/python/sacontext/ > How does one wrap a query in a transaction when using SAContext? Could > someone post some example code? A SQL query or an ORM query? Let's start with what exactly you're trying to do, and how it would be done without SAContext. > Also, I read somewhere that SQL92 defined transactions eliminate the > need to lock tables, is that right? Can't say specifically but MySQL uses "LOCK TABLES" as a poor man's transaction. It prevents inconsistent concurrent writes but does not guarantee the transaction won't be partly completed and partly not, and it can't be rolled back at all. It was good enough for MySQL AB's needs but after deafening clamor from users they finally added InnoDB with real transactions. Anyway, you don't need to lock tables explicitly when using transactions, because that's part of what transactions do. Transaction syntax is also more standardized across database engines than table locking (which isn't standardized at all). -- Mike Orr <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" 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/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
