jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
Subject Re: Handling of InvalidItemStateException
Date Mon, 26 Oct 2009 09:56:08 GMT

On Mon, Oct 26, 2009 at 9:56 AM, Andrey Adamovich
<andrey.adamovich@yahoo.com> 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,

The other approach is to use locking to explicitly synchronize such
competing changes. This strategy is best suited for more complex


Jukka Zitting

View raw message