Really truly ;) , try this with junit, and JR 1.2.2 (1.3 also does it):<br><br><br>public void testIt() throws Exception {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Repository repo = new TransientRepository();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Session sess = repo.login(new SimpleCredentials(&quot;foo&quot;, &quot;password&quot;.toCharArray()));
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Node root = sess.getRootNode();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; 10; i++) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; root.addNode( &quot;&quot; + i + System.currentTimeMillis(), &quot;nt:unstructured&quot; );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
sess.save();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Query q = sess.getWorkspace().getQueryManager().createQuery( &quot;select * from nt:unstructured&quot;, Query.SQL);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; QueryResult qr = q.execute();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NodeIterator ni = qr.getNodes();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //check we get at least something back from the query<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; assertTrue(ni.hasNext());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; assertNotNull(ni.next());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; assertNotNull(
ni.next());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; assertNotNull(ni.next());<br>}<br><br>And start it up, try it about 10 times in a row, at least one time you will see a failure (ie it won&#39;t return anything from the query) - and then a subsequent time it just wont start, wait a few seconds, and then it will work again. 
<br><br>Very very wierd, but somewhat relieved its not my own confused code, this is as simple as I can make it. I can only imagine there is some index sync issue still at play. Unfortunately, there is no way to wrap this up as a proper test, as it needs to startup fresh each time to reliably reproduce this (seperate JVM process each time). 
<br><br>(and this will happen on any OS, I thought it was just linux, but have tried it on mac, windows etc). <br><br>