is this change discussed or agreed somewhere ? or are you just working on a POC ?

Julien Viet
julienviet.com

On Wednesday 22 January 2014 at 15:32, Nicolas Filotto wrote:

If you want to define a new property to a give node type you will indeed have to do what you pointed out (http://docs.jboss.org/exojcr/1.15.7-GA/developer/en-US/html_single/#JCR.NodeTypeRegistration.PracticalHowto), it is not done automatically by the JCR as the default update policy used is IGNORE_IF_EXIST and in your case you need REPLACE_IF_EXISTS as described in the how to. So you will need do it manually and do it within the context of the data migration.

Another approach would be to define a mixin type that only defines your property and add this mixin type on demand to your nodes, this way the old node type won't be modified


On Wed, Jan 22, 2014 at 2:09 PM, Juraci Paixão Kröhling <jpkroehling@redhat.com> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

All,

I'm sorry if the solution is obvious, but I couldn't find anything
that would give me an appropriate solution for this.

Basically, I have a task that involves adding a new property to nodes
[1]. However, when I start GateIn with data generated by an instance
without the patch, I get some exceptions related to the fact that the
new field is not present on the data storage.

Naively, I would expect the JCR to automatically add this new field to
the nodes that don't have it yet (as it would be trivial to just
create this field if it's not present), but it seems it's not the
case. So, I checked the JCR documentation, and there doesn't seems to
be anything related to this scenario, except perhaps for section
1.9.5.3 (Changing or removing existing PropertyDefinition or child
NodeDefinition) [2]

It seems to me that this is a change on a running system, not a
"migration" scenario.

So, the question is: what is the proper way to add a new property to a
node without having problems with the old data?

1 -
https://github.com/jpkrohling/gatein-portal/commit/7627fef1ad6f484c29c8ebd1e2230f3cd769ec6f#diff-ce6f188607a68a6d2697dd1e79999cbaR132

2 -
http://docs.jboss.org/exojcr/1.15.7-GA/developer/en-US/html_single/#JCR.NodeTypeRegistration.PracticalHowto

Thanks!
Juca.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCgAGBQJS39E1AAoJECKM1e+fkPrXwWgH/3hcjzo+wBRgsi5UfdcJOEM5
HGZzE8+OKIDnUVbRVWdpxbEd4r+6HSggcNMx/FbMA6Y0MccCmgECh63rFC+6Xxci
U4/JhyVNJAFTlpCPTD2Jx+Ov8T1DU5x3HZu8SYFEVjQOIbTtVJk9IcT/g7O7xSNY
Q7FY6rdwMqHrQk6jRGOQ+U1BNx0gGdLk5yEcZow3NVqlUIzNtnCooTJxgFLlIA76
ejN4eynOC7i6KJPBS0SWXZEnVPaIxtxWhoAn+djRXVacgigBveamtdTNXJCkQPmv
waP4wAW79mM0HOK9MbFnankhF9tGOFArPqyc7zKopQh4y9ts3oPMPZ99Mt5EOAM=
=iwU2
-----END PGP SIGNATURE-----
_______________________________________________
gatein-dev mailing list
gatein-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/gatein-dev

_______________________________________________
gatein-dev mailing list
gatein-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/gatein-dev