How does one usually deal with such conflict? (two identical(except for 
id's) inserts causing a violation of an unique constraint)

Isolating the insert into its own transaction and then do a db.commit(), 
catch any exception and then ignore?

Thanks

On Wednesday, August 13, 2014 10:57:13 AM UTC-4, Niphlod wrote:
>
> the problem in concurrency (andduplication) isn't the update part, it's 
> the insert part....
>
> On Wednesday, August 13, 2014 1:39:56 PM UTC+2, Leonel Câmara wrote:
>>
>> Couldn't he use a _for_update argument there to make this work in some 
>> adapters?
>>
>> db.mytable.update_or_insert(q, name='test', _for_update=True)
>>
>

-- 
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