On Tuesday, November 17, 2015 at 12:35:31 PM UTC-5, Yoel Benitez Fonseca 
wrote:
>
> Side question: in a module, like in this example, i don't need to call 
> commit() for the table to be created ? 
>

This may depend on the RDBMS, but I think in general you don't need to 
commit a create table. In any case, you shouldn't need to do any commits as 
long as the operations are done during a web2py HTTP request, as all 
requests are wrapped in a transaction and committed at the end of the 
request. This applies to operations done in modules (as long as the code is 
called as part of an HTTP request). You need to explicitly call db.commit() 
only when operating outside of a request, such as in the shell or a script.

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to