Displaying 1 result from an estimated 1 matches for "dispatcherinstance1".
Did you mean:
dispatcherinstance2
2006 May 10
4
validates_uniqueness_of and create atomicity
...ELECT on the underlying table attempting to ensure that a
record with ID(s) specified in the validates_uniqueness_of statement
is not already present, prior to the INSERT (or UPDATE). However, in
between the SELECT and INSERT, an offending record might appear.
example race condition scenario:
A) dispatcherInstance1 is to perform a create on entity Foo, which has
a validates_uniqueness_of
B) dispatcherInstance2 is to perform a create on entity Foo with the
same parameters as in A
C) dispatcherInstance1 enters the validation code and performs its
SELECT, it decides everything is OK
D) dispatcherInstance2 ent...