Hi Brian, Thinking about this, I reach the conclusion that the Cypher statement is running inside a transaction. The transaction isn't closed until after the Cypher statement is closed, and so Cypher can't see what a transaction event handler does inside the transaction.
The reason it worked before is because prior to 2.0, the code that turned a Cypher result into JSON ran after the TX was closed, and so had full view of what tx-event handlers did. In 2.0, with the introduction of read-transactions, we're much more particular about opening and closing transactions, and this is one manifestation of that. Hope this makes sense! Cheers, Andrés On Fri, Jan 24, 2014 at 10:58 PM, brian <[email protected]> wrote: > Environment: > - Neo4j 2.0 > - OS/X > - Oracle Java 1.7 > > I've written a plugin that implements TransactionEventHandler. The > beforeCommit() method adds a number of properties to all Nodes that are > being created in the current transaction (GUID, timestamps, etc). This > worked fine in Neo4j 1.8.3 and 1.9.5. I've rebuilt this plugin against 2.0 > libraries and I'm running into a problem. I'm executing a query via the > REST API that looks like: > > CREATE (n {some properties}) RETURN n > > The problem is that the Node included in the response contains only those > properties I specified in the query. The properties I added to the Node in > the TransactionEventHandler do not appear. If I then do a GET on that node > or issue a query that returns that Node, all properties appear as expected. > So they actually were added to the Node, but were not included in the > response from the original CREATE query. I can reproduce this behavior > programmatically and also via the Neo4j browser. > > Any thoughts? > > -b > > -- > 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/groups/opt_out. > -- The best way to ask for Cypher help: http://console.neo4j.org/usage.html -- 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/groups/opt_out.
