On Sun, Nov 23, 2008 at 3:10 PM, far4ever <[EMAIL PROTECTED]> wrote: > thanks a lot for your kind responses . > i was able to find out what went wrong. > the thing was as id i was passing the same name (hard coded) > and when evert time i run the adding part that new node were created( with > indexes) > but when reading it is just looking in to the node(with out that index). i > think i might be reading a node index where that last node doesn't exists. ( > i think it s reading the first node as default)
That's a feature of JCR and called "same-name siblings" (SNS). It is included in JCR because of XML compatibility (multiple elements of the same name). They have an index at the end of their node name/path, eg. "foobar[1]", with the special case "foobar" == "foobar[1]". The "problem" with SNS is that the index must be calculated dynamically, which makes the path to those nodes instable. For example, if you delete "foobar[2]", the node "foobar[3]" will become "foobar[2]" and so on... For more infos, have a look at rule 4 of David's model [1]. Regards, Alex [1] http://wiki.apache.org/jackrabbit/DavidsModel -- Alexander Klimetschek [EMAIL PROTECTED]