On Thursday, March 12, 2015 at 5:43:30 PM UTC-4, Niphlod wrote:
>
>
> Within the context of a web2py request, wouldn't there be two transactions 
>> open (one for each database)? In that case, at least if the request results 
>> in an error, both transactions would be rolled back.
>>
>> Anthony 
>>
>
> well, pydal isn't used only in web2py's context
>

The context here is within web2py applications.
 

> but even if it was, you'd be forced to call a commit() on the callback (or 
> just before that) to ensure referential integrity when dealing with such 
> scenario.
>

Why would you need a commit()? If everything is happening within a web2py 
request, any open transactions will be rolled back should either database 
throw an error, or if the app code itself results in an exception. So, if a 
record in one database is deleted, but then an exception occurs before the 
linked record in the other database is deleted, the initial delete gets 
rolled back.

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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to