https://github.com/neo4j/neo4j/pull/5010 should fix the afterCommit issue you're seeing. That PR fixes so that there's no transaction associated with the current thread when afterCommit is called, and so a new transaction can be opened there.
On Friday, July 17, 2015 at 1:02:00 PM UTC+2, Mattias Persson wrote: > > In the meantime I believe this PR will reduce confusion regarding > transaction events: https://github.com/neo4j/neo4j/pull/4991 > > On Thursday, July 16, 2015 at 11:28:49 PM UTC+2, Mattias Persson wrote: >> >> Oh I can reproduce that now. Yup, that's a problem, right there >> >> On Thursday, July 16, 2015 at 4:45:58 PM UTC+2, Clark Richey wrote: >>> >>> So when I run my tests without the executor I get an error that the >>> transaction has already completed when I try to examine properties of >>> created / updated nodes. Creating a new transaction doesn't help. >>> >>> Sent from my iPhone >>> >>> On Jul 16, 2015, at 04:57, Mattias Persson <[email protected]> >>> wrote: >>> >>> Hi Clark, >>> >>> I've converted your groovy code into java and run that in a unit test. >>> As far as I can see all events trigger as they should. >>> >>> What I'm worried about is the pattern that seems to be promoted here, >>> namely to queue the event processing in an executor service. The >>> transaction state of a transaction is local to the thread executing the >>> transaction and simply handing over that state to another thread without >>> any memory barriers isn't safe, i.e. it may yield unpredictable results. >>> >>> My advice to you is to simply scrap the executor service and execute >>> whatever logic you need within the same thread that gets the >>> beforeCommit/afterCommit calls. I'll also talk to Max about this, and >>> update the javadocs. >>> >>> Please try this and report back with results. >>> >>> Best, >>> Mattias >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Neo4j" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >>> -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
