Hi, On Mon, Oct 26, 2009 at 9:56 AM, Andrey Adamovich <[email protected]> wrote: > Is this a common pattern how to handle that? Or is it a better way to avoid > such situations?
You said you are fine with the last change "winning". Then why can't you simply ignore the InvalidItemStateException? It's caused by two concurrent changes colliding, so you could just as well treat the winning change as the last one. This strategy is typically only appropriate when the changes being made are simple property updates, etc. The other approach is to use locking to explicitly synchronize such competing changes. This strategy is best suited for more complex changes. BR, Jukka Zitting
