I'm using NeoIndexService. I've tried very hard to reproduce the bug
outside of tomcat but have failed to do so. Rearranging my code a bit
and handling the exceptions better seems to fix this problem, by I
don't know if it's by accident or not.

If I write I create nodes, write properties and index them, and then
in the same transaction try to read them, what happens? I think this
may be what happened for me, but I'm not sure really.

Philip

On 5/11/08, Mattias Persson <[EMAIL PROTECTED]> wrote:
> I guess having each request wrapped in one transaction sounds sane and
>  to answer your previous question the indices (changes to your
>  IndexService) aren't really written until you call tx.finish(). So
>  that's either a bug in the IndexService (btw which one do you use,
>  LuceneIndexService or NeoIndexService?) or your transaction handling
>  may be buggy, however your supplied example seems correct... we'll
>  have to test that more.
>
>  2008/5/10 Philip Jägenstedt <[EMAIL PROTECTED]>:
>
> > On 5/10/08, Johan Svensson <[EMAIL PROTECTED]> wrote:
>  >
>  >> If tx.finish() is never called the transaction will never be committed
>  >>  or rolled back (holding locks/memory).
>  >
>  > I only have a single transaction wrapping everything I do for the
>  > entire request. Not nice maybe, I'm trying to work out some better way
>  > to split it. In any event, it is precisely on the form that you've
>  > written here, but after the request fails once (due to
>  > ServletException thrown when the MusicBrainz webservice is overloaded)
>  > it seems that the indexes created in that very transaction block have
>  > not been rolled back, because next time I run it seems like there's a
>  > hit in the index, followed by a NotFoundException. I can reproduce
>  > this seemingly reliably (well, it depends on the musicbrainz
>  > webservice getting overloaded, but anyway) if I shut down tomcat,
>  > remove my data store and run from scratch.
>  >
>  > In other words, the index seems to have been updated/not rolled back
>  > even though I never called success().
>  >
>  > Bug?
>  >
>  > Philip
>  >
>  >> When manually managing transactions always make use of a try finally 
> block:
>  >
>  > Is there a non-manual way to handle transactions? Sounds comfortable...
>  >
>  > Philip
>
> > _______________________________________________
>  > Neo mailing list
>  > User@lists.neo4j.org
>  > https://lists.neo4j.org/mailman/listinfo/user
>  >
>
> _______________________________________________
>  Neo mailing list
>  User@lists.neo4j.org
>  https://lists.neo4j.org/mailman/listinfo/user
>
>
_______________________________________________
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to