On 2010-10-25 13.54, Rickard Öberg wrote:
On 2010-10-25 13.47, Rickard Öberg wrote:
I have just found a major issue in how JSONMapEntityStore (and all
stores based on it) work, based on a recent change just before the 1.2
release. Basically all existing data becomes unusable. If you use Qi4j
in production with any of those entitystores, do NOT upgrade right now
until we have sorted this out.

Ok, the changes seem to actually only be in 1.3-SNAPSHOT, and not in the
1.2-release, so doing an upgrade to 1.2 final is ok. 1.3-SNAPSHOT still
has issues we need to fix.

The changes that screwed up entitystores have been reverted. Feel free to use HEAD again with your existing databases.

The main issue was that Stanislav found that if an Entity has two mixins with properties of the same name, they would overwrite each other since they are stored in JSON with the name and not the qualified name. He then (on his own and without communicating it) changed that to use qualified names, which of course makes any existing data unreadable. These changes have now been reverted (as has Stanislavs commit rights).

The main reasons we used the simple property name instead of the qualified property name is that it makes refactoring of data within an entity much easier. You can split mixins, combine mixins, rename mixins, and all sorts of things, without having to do any database refactoring. In the past I have found this convenience to be quite useful, especially in the early phase when where properties are defined tend to change a lot. Another reason is that since using qualified names would ONLY be useful if there is a clash, it's a lot of overhead to store the qualified names "just in case".

But the issue remains that if you are not careful, you can end up with an entity that have many properties with the same name, and which will give you trouble without warning. My suggestion to this is that we simply add a warning, maybe even consider the assembly faulty, if an entity has several properties (or associations) with the same name. That would ensure that it's impossible to get an application that has these issues.

WDYT? Any other ideas?

/Rickard


_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to