You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Michael Wechner <mi...@wyona.com> on 2009/02/12 09:06:18 UTC

Lock/Block write access in order to maintenance of the repository

Hi

In order to do some "maintenance" of my Jackrabbit/JCR based repo during 
production (for example migrating to another repo implementation) I 
would like to block/lock all write access. Is there some simple 
"switch"? And if so, how does my application know about it (such that it 
can communicate it to the end-user)?

I have been searching and found the following

http://www.nabble.com/Snapshot-of-local-data-(in-sync-with-DB)-td19924825.html
http://mail-archives.apache.org/mod_mbox/jackrabbit-commits/200811.mbox/%3C472701467.1227186960024.JavaMail.www-data@brutus%3E

but it's not really clear to me and how to make use of it.

Any other pointers/hints are much appreciated

Thanks

Michael

Re: Lock/Block write access in order to maintenance of the repository

Posted by Michael Wechner <mi...@wyona.com>.
Thomas Müller schrieb:
> Hi,
>
> right, but how does the application know that the exception thrown by
>   
>> Jackrabbit is because the backend was set to read-only
>> and not for instance by some permission or some other problem?
>>     
>
>
> Jackrabbit doesn't have well defined 'exception codes'. However, there are
> multiple exception classes (AccessDeniedException, ItemNotFoundException and
> so on). What about you try and tell us if there are problems?
>   

will do :-)

Cheers

Michael
> Regards,
> Thomas
>
>   


Re: Lock/Block write access in order to maintenance of the repository

Posted by Thomas Müller <th...@day.com>.
Hi,

right, but how does the application know that the exception thrown by
> Jackrabbit is because the backend was set to read-only
> and not for instance by some permission or some other problem?


Jackrabbit doesn't have well defined 'exception codes'. However, there are
multiple exception classes (AccessDeniedException, ItemNotFoundException and
so on). What about you try and tell us if there are problems?

Regards,
Thomas

Re: Lock/Block write access in order to maintenance of the repository

Posted by Michael Wechner <mi...@wyona.com>.
Thomas Müller schrieb:
> Hi,
>
> ok, but I guess Jackrabbit then throws  some "cannot write" exception (in
>   
>> the case of writing), whereas  it's not going to be clear
>> to the application why this is happening, right?
>>     
>
>
> Yes. You could catch the exception and re-throw one with a better message.
>   

right, but how does the application know that the exception thrown by 
Jackrabbit is because the backend was set to read-only
and not for instance by some permission or some other problem?

Thanks

Michael
> Regards,
> Thomas
>
>   


Re: Lock/Block write access in order to maintenance of the repository

Posted by Thomas Müller <th...@day.com>.
Hi,

ok, but I guess Jackrabbit then throws  some "cannot write" exception (in
> the case of writing), whereas  it's not going to be clear
> to the application why this is happening, right?


Yes. You could catch the exception and re-throw one with a better message.

Regards,
Thomas

Re: Lock/Block write access in order to maintenance of the repository

Posted by Michael Wechner <mi...@wyona.com>.
Thomas Müller schrieb:
> Hi,
>
> What about making the backend read-only?
>   

ok, but I guess Jackrabbit then throws  some "cannot write" exception 
(in the case of writing), whereas  it's not going to be clear
to the application why this is happening, right?

(I think it would be important that the application can communicate to 
the end-user that the system is currently in maintenance mode and hence 
writing/saving data is blocked, whereas of course one could add a switch 
to the application itself and set the backend to read-only, but that 
doesn't seem to me very elegant and I could image leads to other problems)

Thanks

Michael
> Regards,
> Thomas
>
>
> On Thu, Feb 12, 2009 at 9:06 AM, Michael Wechner
> <mi...@wyona.com>wrote:
>
>   
>> Hi
>>
>> In order to do some "maintenance" of my Jackrabbit/JCR based repo during
>> production (for example migrating to another repo implementation) I would
>> like to block/lock all write access. Is there some simple "switch"? And if
>> so, how does my application know about it (such that it can communicate it
>> to the end-user)?
>>
>> I have been searching and found the following
>>
>>
>> http://www.nabble.com/Snapshot-of-local-data-(in-sync-with-DB)-td19924825.html<http://www.nabble.com/Snapshot-of-local-data-%28in-sync-with-DB%29-td19924825.html>
>>
>> http://mail-archives.apache.org/mod_mbox/jackrabbit-commits/200811.mbox/%3C472701467.1227186960024.JavaMail.www-data@brutus%3E
>>
>> but it's not really clear to me and how to make use of it.
>>
>> Any other pointers/hints are much appreciated
>>
>> Thanks
>>
>> Michael
>>
>>     
>
>   


Re: Lock/Block write access in order to maintenance of the repository

Posted by Thomas Müller <th...@day.com>.
Hi,

What about making the backend read-only?

Regards,
Thomas


On Thu, Feb 12, 2009 at 9:06 AM, Michael Wechner
<mi...@wyona.com>wrote:

> Hi
>
> In order to do some "maintenance" of my Jackrabbit/JCR based repo during
> production (for example migrating to another repo implementation) I would
> like to block/lock all write access. Is there some simple "switch"? And if
> so, how does my application know about it (such that it can communicate it
> to the end-user)?
>
> I have been searching and found the following
>
>
> http://www.nabble.com/Snapshot-of-local-data-(in-sync-with-DB)-td19924825.html<http://www.nabble.com/Snapshot-of-local-data-%28in-sync-with-DB%29-td19924825.html>
>
> http://mail-archives.apache.org/mod_mbox/jackrabbit-commits/200811.mbox/%3C472701467.1227186960024.JavaMail.www-data@brutus%3E
>
> but it's not really clear to me and how to make use of it.
>
> Any other pointers/hints are much appreciated
>
> Thanks
>
> Michael
>