You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by ms...@email.cz on 2013/02/14 10:07:39 UTC

Question about Node.setProperty

Hello,

I want to ask if Node.setProperty(String,String,PropertyType.REFERENCE) does
some consistency check of input
node id? I know once property is set it is not possible to remove node 
because of existing reference. So I want to know
when is consistency check performed when new reference property is added.

Thanks

Marek

Re: Question about Node.setProperty

Posted by Angela Schreiber <an...@adobe.com>.
hi marek

the JCR specification mandates that a referenceable node cannot be
removed as long there are reference properties pointing to it.

whether that constraint is enforced on transient changes or just
once the changes are persisted is AFAIK an implementation detail.
if i remember correct jackrabbit-core immediately enforces that
constraint while the other implementation in jcr2spi doesn't.

if you don't need that reference-consistency you may want use
a property of type WEAKREFERENCE or maybe even PATH.

regards
angela

On 2/14/13 10:07 AM, mslama@email.cz wrote:
> Hello,
>
> I want to ask if Node.setProperty(String,String,PropertyType.REFERENCE) does
> some consistency check of input
> node id? I know once property is set it is not possible to remove node
> because of existing reference. So I want to know
> when is consistency check performed when new reference property is added.
>
> Thanks
>
> Marek