Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-15-2020 07:16 AM
Hello !
I am currently testing neo4j inside a async framework
Reading of node is done with this code
fun <T> read(query: String, action: Action<T>): Multi<T> =
Multi.createFrom().resource(driver::rxSession) { rxs ->
rxs.readTransaction { tx ->
val rs = tx.run(query.trimIndent())
Multi.createFrom().publisher(rs.records()).map {
action(it)
}
}
}.withFinalizer(Consumer { it.uniClose() })
What I do not understand is when I want to update I changed the code to a write transaction with this query
MATCH (d:Descriptable {key:"Robbie"})
SET d.title = '01ESKEPEMRXHVQ1PN3SQWCE2Z8'
RETURN d
It is the same query than read but read is working but write never start the publisher
It emits nothing like there is no record !!!
but the exact query run into the browser and return a result
fun <T> write(query: String, action: Action<T>): Multi<T> =
Multi.createFrom().resource(driver::rxSession) { rxs ->
rxs.writeTransaction { tx ->
val rs = tx.run(query.trimIndent())
Multi.createFrom().publisher(rs.records()).map {
action(it)
}
}
}.withFinalizer(Consumer { it.uniClose() })
What do I miss ???
Regards
Robert
12-20-2020 03:45 PM
Don't you need to start consuming from the reactive type?
So when your downstream consumer starts reading from the multi it should do the update.
All the sessions of the conference are now available online