Created
September 14, 2011 05:02
Revisions
-
koush created this gist
Sep 14, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ new Thread() { var entity = db.get('foo'); // entity.siblings = [] due to race condition entity.siblings.push('boo'); // entity.siblings = ['boo'] db.put('foo', entity); // one of these puts overwrote the other... }.start(); new Thread() { var entity = db.get('foo'); // entity.siblings = [] due to race condition entity.siblings.push('bar'); // entity.siblings = ['bar'] db.put('foo', entity); // one of these puts overwrote the other... }.start();