On Thursday, July 19, 2018 at 11:25:28 AM UTC-4, Lisandro wrote: > > That was my first thought: in some cases, another request deletes the > record right in the instant between the execution of the first and second > line. > But I thought it wasn't possible because the function runs inside a db > transaction. Or could it still happen? >
Well, I guess since the record is updated via .update_record, it should remain locked until the transaction is complete (depending on the database). > Another thought is that the row.id is removed or set to None by > row.update_record(**data), so the next line would set row to None, thus > triggering the error. > Or the update changes the "id" of the original record. But according to the code of .update_record, neither of those things can happen (not even in web2py 2.10), as the "id" field is explicitly excluded from being updated either in the database or in the Row object itself. 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.