You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Ben Short <be...@benshort.co.uk> on 2009/11/21 21:11:48 UTC
Calling session.save()
Hi,
Is it costly to call session.save() if the session has only been used for
reading?
Regards
Ben Short
Re: Calling session.save()
Posted by Ben Short <be...@benshort.co.uk>.
Frank,
I hadn't spotted that method. Thanks
Ben
2009/11/21 François Cassistat <f...@maya-systems.com>
> I don't really know, but if so, you could consider using boolean
> Session.hasPendingChanges() to see if there is any change to save before
> saving. (But be careful of concurrent access then.)
>
>
> http://www.day.com/maven/jsr170/javadocs/jcr-2.0/javax/jcr/Session.html#hasPendingChanges()
>
>
> Frank
>
>
>
> Le 09-11-21 à 15:11, Ben Short a écrit :
>
>
> Hi,
>>
>> Is it costly to call session.save() if the session has only been used for
>> reading?
>>
>> Regards
>>
>> Ben Short
>>
>
>
Re: Calling session.save()
Posted by François Cassistat <f...@maya-systems.com>.
I don't really know, but if so, you could consider using boolean
Session.hasPendingChanges() to see if there is any change to save
before saving. (But be careful of concurrent access then.)
http://www.day.com/maven/jsr170/javadocs/jcr-2.0/javax/jcr/Session.html#hasPendingChanges()
Frank
Le 09-11-21 à 15:11, Ben Short a écrit :
> Hi,
>
> Is it costly to call session.save() if the session has only been
> used for
> reading?
>
> Regards
>
> Ben Short
Re: Calling session.save()
Posted by Stefan Guggisberg <st...@gmail.com>.
On 21.11.2009, at 21:11, Ben Short <be...@benshort.co.uk> wrote:
> Hi,
>
> Is it costly to call session.save() if the session has only been
> used for
> reading?
>
no, in this case save is almost a no-op.
cheers
stefan
> Regards
>
> Ben Short