On Nov 25, 5:23 am, "Paul Johnston" <[EMAIL PROTECTED]> wrote: > TG 1.0/1.1 branches do automatic transactions and work with SA 0.3.10+ > and 0.4. The code works quite reliably (various corner cases are > handled), but is not particularly elegant. If we didn't support SA 0.3 > we probably would use a transactional session, but to make supporting > both versions simpler, we use manual transaction methods on a > non-transactional session (which has exactly the same effect in the > end).
Ah ok. Yeah I wasn't too sure what the code was doing that's why I was asking. I'm still not too sure about how to get automatic transaction with SA working like Kevin did with SQLObject in the 20 min Wiki. Ideally, I'd like to get autoflush and automatic transactions setup in 2 places, my controllers and turbogears.testutils.DBTest. In my controllers, can I just call session.save(entity) and let SA's unit of work commit the next time someone queries for entity or do I still have to call session.begin() and commit() in every controller method? As to the DBTest class, it seems that it's setUp and tearDown methods are only meaningful if you are using SO. If need to use SA, you basically have to roll your won DBTest class if you want a scoped session with auto flush and auto transaction. Am I right or if there's something in TG to help me with this? Yuen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" 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/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

