cancel
Showing results for 
Search instead for 
Did you mean: 

Query without TX in Spring

chris3
Graph Buddy

What is the best practice to execute a query WITHOUT a transaction inside a Java Spring-Data-Neo4j app?

Is there an easy way to get to a driver's session (instead of an OGM session) or an even better solution to do this?

Reason for asking:
I want to do USING PERIODIC COMMIT 10000 LOAD CSV but I can't do that on the normal OGM session since that always wraps the call in a TX.

2 REPLIES 2

Luanne_Misquitt
Node Clone

This is not possible, there is always a transaction. Even without the OGM/SDN, Neo4j is transactional.
SDN is not really suitable for data import (see When not to use SDN) and you might want to look at other mechanisms for this. You could execute a script, or use the Bolt driver directly as an example.

That's exactly my point: I am doing it already directly on the Bolt driver but since I already have a working configuration (URL, Username, Password) set up for SDN I was wondering if there is an easier way to get to the DB driver

OR to avoid the session.query to always execute the query inside a TX.

...I guess not... thx for your reply!

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.