Quoting Rickard Öberg <[email protected]>:
On 2010-10-23 18.18, Stanislav Muhametsin wrote:
Came to think about it, I think the query-option might be thread-unsafe.
Is the following situation possible?
<snip>
Correct, there's no way to guarantee that what you described doesn't
happen, unless you want a singleton somewhere that both have to
serialize on. So naturally, if you go distributed it gets even worse.
Requiring global uniqueness is a constraint that should be REALLY
REALLY well thought-through (i.e. does the business really need it)
before doing, because of the inherent difficulty in ensuring it.
Let's assume that I have really well thought it through, and I ended
up in decision that global uniqueness must be ensured. How can I
ensure it then, from Qi4j-point of view?
If only way to ensure global uniqueness is to make entity's identity
somehow depenendent on uniqueness qualifications, I think I might drop
this requirement in this particular case that brought up this whole
issue. Since things get complicated if I have entity composite with
multiple roles modifying its entity. But it would be nice to know what
tools I have to ensure global uniqueness, in case I actually need it
in future.
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev