He, I am working on the following bug:
If you create a node, and then store that node in the database, fields
that are specified as 'not null' should be set wither with a default
value or throw and exception (the latter gives backward compatibility
issues so is only done for NODE fields).
While this is done correctly in the database, the node that is committed
is not itself updated.
This means that in the in-memory node, even after a commit, some values
may be null while their database counterpart isn't.
i.e.:
Node node = nodemanager.createNode();
node.commit();
assert(node.getValue("my_not_nullable_field") == null ); // gives true...!
There are two solutions:
- If a node is stored, the node is upodated with new data if the field
is not-null and the value is.
- If a node is created, all non-null fields are filled with a default
value. The storagemanager should throw an exception if the nodes still
contains null-values for some reason.
Currently I am working on solution #1. In fact I have written code that
reloads a node from the db after committing it, but I think that may be
a bit too much overhead - I am using it to test some stuff but I will
probably not check it in.
However if the majority feels that I should work on solution #2, I'm
happy to go that way, too.
--
Pierre van Rooden
Mediapark, C 107 tel. +31 (0)35 6772815
"Never summon anything bigger than your head."