On Friday, February 24, 2012 12:13:20 PM UTC-5, Wikus van de Merwe wrote: > > The code in controllers is wrapped in web2py with a try except clause that > automatically commits or rolls back the changes to db. I believe this is > not the case for modules and an explicit commit is needed there. Try to add > "db.commit" to your module code. >
You only need to use db.commit (and db.rollback) if using the DAL from outside of a web2py application. Ultimately, the module code is called from a model or controller, which is executed by web2py in the try/except clause, so commits and rollbacks will happen automatically, even for DAL operations in modules. Anthony