jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmail.com>
Subject Re: search index corruption?
Date Sat, 02 Oct 2004 14:34:25 GMT
The search is currently implemented in a quite basic fashion. 
which means if the Repositry is not shutdown propertly, lucene might leave
a lock file in your temp folder.
that's why the lock timout exception occurs when you start your test
the second time. lucene assumes that another process is still using the index
and then gives up after some time.

you have to add the following line at the end to your test:

repof.shutdown();

this will shutdown the repository properly. 

On a windows machine the lock file is usually created in:
Documents and Settings/<userid>/Local Settings/Temp/luceneXXXX.lck
 
after you delete the file the repository will start again.

I will change the location where the lock file is created. it probably 
makes sense to create it in the index directory itself...

regards,
 marcel

On Sat, 2 Oct 2004 15:06:22 +0200, David Nuescheler
<david.nuescheler@gmail.com> wrote:
> hi guys,
> 
> i was looking into doing some very simple benchmarks to see
> how fast jackrabbit can create nodes.
> 
> my test script:
> --------
> import org.apache.jackrabbit.core.RepositoryFactory;
> import javax.jcr.*;
> 
> public class PerfTest {
> 
>     public static void main (String[] args) {
>         try {
>             RepositoryFactory repof = RepositoryFactory.create(args[0]);
>             Repository repo=repof.getRepository("localfs");
>             Session session=repo.login(new
> SimpleCredentials("uncled","".toCharArray()),"default");
>             Node root=session.getRootNode();
>             System.out.println(root.getProperty("jcr:primaryType").getString());
>             if (root.hasNode("perftest")) {
>                 root.remove("perftest");
>             }
>             Node testroot=root.addNode("perftest", "nt:unstructured");
>             root.save();
>             long start=System.currentTimeMillis();
>             int i=0;
>             while (i<10) {
>                 Node testnode=testroot.addNode("test"+i,"nt:unstructured");
>                 System.out.println(testnode.getPath());
>                 i++;
>             }
>             testroot.save();
>             long done=System.currentTimeMillis();
>             System.out.println("time:"+(done-start)+"ms");
>             session.logout();
>         } catch (RepositoryException ex) {
>             System.err.println(ex.toString());
>         }
>     }
> }
> 
> ----
> 
> if i clear (rm -rf) my "repositories" directory and start this test
> for the first time everything seems to work. if i start the same
> test repeatedly i get the following exception:
> 
> 02.10.2004 14:53:54 *ERROR* [main] SearchManager: error indexing node.
> (SearchManager.java, line 206)
> java.io.IOException: Lock obtain timed out
>         at org.apache.lucene.store.Lock.obtain(Lock.java:97)
>         at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:173)
>         at org.apache.jackrabbit.core.search.lucene.AbstractIndex.getIndexWriter(AbstractIndex.java:101)
> 
> am i missing something? probably ;)
> 
> regards,
> david
> ----------------------------------------------------------------------
> standardize your content-repository !
>                                http://www.jcp.org/en/jsr/detail?id=170
> ---------------------------------------< david.nuescheler@day.com >---
> 
> This message is a private communication. If you are not the intended
> recipient, please do not read, copy, or use it, and do not disclose it
> to others. Please notify the sender of the delivery error by replying
> to this message, and then delete it from your system. Thank you.
> 
> The sender does not assume any liability for timely, trouble free,
> complete, virus free, secure, error free or uninterrupted arrival of
> this e-mail. For verification please request a hard copy version.
> 
> mailto:david.nuescheler@day.com
> http://www.day.com
> 
> David Nuescheler
> Chief Technology Officer
> Day Software AG
> Barfuesserplatz 6 / Postfach
> 4001 Basel
> Switzerland
> 
> T  41 61 226 98 98
> F  41 61 226 98 97
> 
> 



-- 
-----------------------------------------< marcel.reutegger@gmail.com >---
You can have it good, cheap, or fast. Any two. --Arthur C. Clarke
-----------------------------------------------< http://www.day.com >---

Mime
View raw message