> From reading the TG2.1 docs I thought I understood that as long as I > add SQLAlchemy objects to a DBSession, using DBSession.add, and > flushing the session when I'm done all of my transaction logic is > handled by TG middleware. > > However now I came across this page in the docs: > http://www.turbogears.org/2.1/docs/main/Config/SQLAlchemy.html?highlight=use_transaction_manager > > And read about this: > "TurboGears takes advantage of repoze’s transaction manager software. > Basically, the transaction manager wraps each of your controller > methods, and should a method fail, the transaction will roll back. if > you utilize the transaction manager, then the result of a successful > method call results in a commit to the database. If the contoller > method does not utilize the database, there is no database interaction > performed. What this means is that you never have to worry about > committing, or rolling back when controller code fails, TG handles > this for you automatically." > > Which sounds great, however, I read that i was supposed to check > whether base_config.use_transaction_manager was set to true but > didn't find that setting at all in my config files. I added: > base_config.use_transaction_manager = True > to my app_cfg.py file. > > Now I'm wondering, how can I check that this magic is working? How can > test that my transactions are being commited thru this mechanism > properly?
The magic is already working if rows appear in the DB. I don't know about this config-option (looks like app_cfg.py-based), but there is already a TM at work, probably through repoze.tm2. Diez -- 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.

