0
votes

I'm using:

  • spring-data-neo4j 4.2.0.BUILD-SNAPSHOT
  • neo4j-ogm 2.1.0-SNAPSHOT
  • neo4j 3.0.7

and I'm having problems with the new X-Write HTTP header set by neo4j-ogm.

We use this header in our HAProxy configuration to redirect write transactions to master neo4j node.

Our spring-data-neo4j write transactions are doing multiple calls to neo4j:

  • POST .../db/data/transaction/1 {"statements":[{"statement":"request1"}...]}
  • POST .../db/data/transaction/1 {"statements":[{"statement":"request2"}...]}
  • POST .../db/data/transaction/1/commit

All HTTP REST calls correctly contain the X-WRITE header, except the last call to commit the transaction that seem not to contain this header. So this call is sometimes sent to a slave node where the transaction is not existing.

Is it a bug in neo4j-ogm ?

2

2 Answers

1
votes

Yes, it is a bug and a stupid one. I've raised a ticket for it. https://github.com/neo4j/neo4j-ogm/issues/299.

I'll update the answer here, and on the ticket when this is complete.

1
votes

This has been fixed in neo4j-ogm 2.1.1-SNAPSHOT via https://github.com/neo4j/neo4j-ogm/pull/300.

X-WRITE should now appear in the header on commit/rollback.