Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-15-2022 02:13 PM
If the following query is executed in a read-transaction and another write transaction commits during its execution, what does that imply?
MATCH (n:Entity {asset_id: $%s, version: $%s, id: $%s})
with n
CALL apoc.path.subgraphAll(n, {
relationshipFilter : 'CHILD_OF>|<ATTACHED_TO',
optional: true
}) yield nodes, relationships
with n, nodes as ascNodes, relationships as ascRel
CALL apoc.path.subgraphAll(n, {
relationshipFilter : '<CHILD_OF|<ATTACHED_TO',
optional: true
}) yield nodes, relationships
with n, nodes as descNodes, relationships as descRel , ascNodes, ascRel
CALL apoc.path.subgraphAll(n, {
relationshipFilter : '<CHILD_OF|<ATTACHED_TO|REFERS_TO',
optional: true
}) yield nodes, relationships
with n, nodes as refNodes, relationships as refRel , ascNodes, ascRel, descNodes, descRel
CALL apoc.path.subgraphAll(refNodes, {
relationshipFilter : 'CHILD_OF>|<ATTACHED_TO',
optional: true
}) yield nodes, relationships
with n, nodes as refAscNodes, relationships as refAscRel, refNodes, refRel, ascNodes, ascRel, descNodes, descRel
RETURN DISTINCT *
Will it only see data committed before the read-transaction begins, or will the individual statements within this query see newly committed data?
In other words, is the read-committed boundary the read transaction, or individual operations within the read transaction?
07-15-2022 03:33 PM
From the documentation, "Transactions in Neo4j use a read-committed isolation level, which means they will see data as soon as it has been committed but will not see data in other transactions that have not yet been committed."
Based on that, I would assume your read operations will see the data as soon as it is committed. It would be very difficult to do otherwise, as your transaction would need to take a snapshot of the entire database to ensure the data remains as is throughout your transaction.
https://neo4j.com/docs/java-reference/current/transaction-management/
All the sessions of the conference are now available online