If there are concurrent requests both trying to create document with same primary key, only one of them will go through and not overwrite due to conditional expression check in save. This is great!
If the failed concurrent request then tries to reload to get the latest record, it does get all the attributes except @new_record is not set to false causing Dynamoid::Errors::RecordNotUnique again.
If there are concurrent requests both trying to create document with same primary key, only one of them will go through and not overwrite due to conditional expression check in
save
. This is great!If the failed concurrent request then tries to
reload
to get the latest record, it does get all the attributes except@new_record
is not set tofalse
causingDynamoid::Errors::RecordNotUnique
again.Is this intentional?