You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Paco Avila <pa...@git.es> on 2006/08/03 20:08:18 UTC

error in node.save() don't cancel child added node

I'm implementing my AccessManager and when an user add a document into a
folder where he can't write, the application fails on paren node save().
That is ok because of lack of privilegies. But the "added" node can be
accesed in user session ¿? Why? If the node failed on save() it should
be discarded, isn't it?

Thanks!

-- 
Paco Avila <pa...@git.es>


Re: error in node.save() don't cancel child added node

Posted by Paco Avila <pa...@git.es>.
El vie, 04-08-2006 a las 09:54 +0200, Marcel Reutegger escribió:
> Paco Avila wrote:
> > ok, so I need to remove it manually. Thanks!
> 
> or better use Item.refresh(false) which is something like a revert on 
> that Item and its descendants.
> 
> See:
> http://www.day.com/maven/jsr170/javadocs/jcr-1.0/javax/jcr/Item.html#refresh(boolean)
> 

Oh, thanks i was looking for something like this. I was reading the
specification and didn't see it. Id didn't know that refresh(false) was
a discard :)
-- 
Paco Avila <pa...@git.es>


Re: error in node.save() don't cancel child added node

Posted by Marcel Reutegger <ma...@gmx.net>.
Paco Avila wrote:
> ok, so I need to remove it manually. Thanks!

or better use Item.refresh(false) which is something like a revert on 
that Item and its descendants.

See:
http://www.day.com/maven/jsr170/javadocs/jcr-1.0/javax/jcr/Item.html#refresh(boolean)

regards
  marcel

Re: error in node.save() don't cancel child added node

Posted by Paco Avila <pa...@git.es>.
El jue, 03-08-2006 a las 20:35 +0200, Thomas Scheffler escribió:
> Am Donnerstag, 3. August 2006 20:24 schrieb Paco Avila:
> > El jue, 03-08-2006 a las 20:16 +0200, Tobias Bocanegra escribió:
> > > if the save fails, no item is persisted and the node remains in the
> > > transient space of his session.
> >
> > ok, the others users can't see this node, but the "adder" user can. How
> > do I elimnate this node from the "adder" user session? If the node can't
> > be added because of lack of privileges it shold be automatically removed
> > from transiente space?
> 
> This would be like clearing your whole word document if you don't have 
> necessary write permissions on FIRST save attempt to a directory. Nobody 
> really want to have this "feature"!
> If you can not save your node you maybe want to try to save it as child of 
> another node or discard it manually.

ok, so I need to remove it manually. Thanks!
-- 
Paco Avila <pa...@git.es>


Re: error in node.save() don't cancel child added node

Posted by Paco Avila <pa...@git.es>.
El jue, 03-08-2006 a las 20:35 +0200, Thomas Scheffler escribió:
> Am Donnerstag, 3. August 2006 20:24 schrieb Paco Avila:
> > El jue, 03-08-2006 a las 20:16 +0200, Tobias Bocanegra escribió:
> > > if the save fails, no item is persisted and the node remains in the
> > > transient space of his session.
> >
> > ok, the others users can't see this node, but the "adder" user can. How
> > do I elimnate this node from the "adder" user session? If the node can't
> > be added because of lack of privileges it shold be automatically removed
> > from transiente space?
> 
> This would be like clearing your whole word document if you don't have 
> necessary write permissions on FIRST save attempt to a directory. Nobody 
> really want to have this "feature"!
> If you can not save your node you maybe want to try to save it as child of 
> another node or discard it manually.

If I can't add a child document node (parent.addNode()) and fails how
can I save on another node? I don't think that this failed child noche
have to be in my session. If its insertion fails, nothing should be
done. If I do a SQL INSERT and fails, the failed inserted row is not in
my sql session.
-- 
Paco Avila <pa...@git.es>


Re: error in node.save() don't cancel child added node

Posted by Thomas Scheffler <th...@uni-jena.de>.
Am Donnerstag, 3. August 2006 20:24 schrieb Paco Avila:
> El jue, 03-08-2006 a las 20:16 +0200, Tobias Bocanegra escribió:
> > if the save fails, no item is persisted and the node remains in the
> > transient space of his session.
>
> ok, the others users can't see this node, but the "adder" user can. How
> do I elimnate this node from the "adder" user session? If the node can't
> be added because of lack of privileges it shold be automatically removed
> from transiente space?

This would be like clearing your whole word document if you don't have 
necessary write permissions on FIRST save attempt to a directory. Nobody 
really want to have this "feature"!
If you can not save your node you maybe want to try to save it as child of 
another node or discard it manually.

Thomas

Re: error in node.save() don't cancel child added node

Posted by Paco Avila <pa...@git.es>.
El jue, 03-08-2006 a las 20:16 +0200, Tobias Bocanegra escribió:
> if the save fails, no item is persisted and the node remains in the
> transient space of his session.

ok, the others users can't see this node, but the "adder" user can. How
do I elimnate this node from the "adder" user session? If the node can't
be added because of lack of privileges it shold be automatically removed
from transiente space?

> 
> On 8/3/06, Paco Avila <pa...@git.es> wrote:
> > I'm implementing my AccessManager and when an user add a document into a
> > folder where he can't write, the application fails on paren node save().
> > That is ok because of lack of privilegies. But the "added" node can be
> > accesed in user session ¿? Why? If the node failed on save() it should
> > be discarded, isn't it?
> >
> > Thanks!
> >
> > --
> > Paco Avila <pa...@git.es>
> >
> >
> 
> 
-- 
Paco Avila <pa...@git.es>


Re: error in node.save() don't cancel child added node

Posted by Tobias Bocanegra <to...@day.com>.
if the save fails, no item is persisted and the node remains in the
transient space of his session.

On 8/3/06, Paco Avila <pa...@git.es> wrote:
> I'm implementing my AccessManager and when an user add a document into a
> folder where he can't write, the application fails on paren node save().
> That is ok because of lack of privilegies. But the "added" node can be
> accesed in user session ¿? Why? If the node failed on save() it should
> be discarded, isn't it?
>
> Thanks!
>
> --
> Paco Avila <pa...@git.es>
>
>


-- 
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---