You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Manuel Simoni <ma...@systemone.at> on 2006/02/27 19:43:19 UTC

recovering from unclean shutdown

Hi,

Does the JCR repository ever go into a unknown state, IOW, if I
encounter a .lock file during startup, can I just delete and ignore it,
or do I have to recover from a backup, if I want to be on the safe side?

Thanks.

Manuel


Re: recovering from unclean shutdown

Posted by Marcel Reutegger <ma...@gmx.net>.
Manuel Simoni wrote:
> Does the JCR repository ever go into a unknown state, IOW, if I
> encounter a .lock file during startup, can I just delete and ignore it,
> or do I have to recover from a backup, if I want to be on the safe side?

The .lock is only used to prevent multiple jackrabbit instances run on 
the same underlying data. It does not indicate that the repository is in 
an unknown state. You should not have to delete the file manually. 
Jackrabbit will check if the .lock file is actively locked by another 
process and if not remove the .lock file and proceed with regular startup.

If you use a transactional persistence manager (PM) such as 
DerbyPersistenceManager the repository should never go into an unknown 
state. If it does then it's a bug.
A transactional PM guarantees that a JCR transaction is always applied 
as a whole or not at all.

There is a slight chance that the lucene index that jackrabbit uses to 
execute queries goes out of sync. Changes on the index and the PM are 
currently handled sequencially and not in a two-phase commit.
See also: http://issues.apache.org/jira/browse/JCR-204

regards
  marcel