HNHacker News
TopNewBestAskShowJobs

smerchek

55 karma · joined August 5, 2015

submissionscomments
smerchek··on Taking the 'D' Out of CRUD with Soft Updates
The version is part of the WHERE clause in the UPDATE statement. Therefore, it is only possible to update the version of the entity that you were updating. If the entity is updated before your statement, it would not succeed in updating the row.

Is there a different concurrency issue I'm not seeing caused by updating the version in the trigger?

smerchek··on Taking the 'D' Out of CRUD with Soft Updates
Totally noticed this in google analytics, earlier. Whoops. It's now fixed!
smerchek··on Taking the 'D' Out of CRUD with Soft Updates
Concurrency issues can be solved by restricting the UPDATE to the version passed in by the application.

If I think I'm updating version 2 of an entity, then only update that version, otherwise throw an error.

I've updated the post to address this scenario.

smerchek··on Taking the 'D' Out of CRUD with Soft Updates
Valid question though, I've updated the post to be more explicit and added a couple more query examples.
smerchek··on Taking the 'D' Out of CRUD with Soft Deletes
Right. I think updates are just as destructive, and oftentimes completely change the meaning on an entity. That's why I also wrote about using soft updates: http://scottsmerchek.com/2015/08/04/taking-the-d-out-of-crud...