Open noisyboiler opened 10 years ago
Probably a overseen issue due to missing tests in this area. Since Neo4j 2.0 all graph operations require a transaction also for reading. So the GeoServer integration might have this issue in many more places. Not sure how to test the implementation of the GeoServer APIs (know too little about them).
Would you mind taking a look?
In most cases just putting a transactional block around the call is good enough. Like this:
try (Transaction tx = graphDb.beginTx()) {
access code
tx.success(); // mostly needed for write operations but also doesn't hurt for read ops
}
The transaction is automatically closed when the try-block is closed.
That has worked a charm, thanks. Happy to raise a PR with any such fixes I need to add?
Hi Michael
I did manage to mostly achieve what i wanted. I had to wrap a LOT of calls
with the try
pattern. Surely there is a DRYer way to achieve this? Maybe
at a lower level nearer the connection?
Have you got any plans to update the transaction handling? Every time I try something new on GeoServer with Neo4j something goes bang, so there is little point in submitting my PR. It's also too much repeated code!!
Happy to help if I can.
Simon
On 17 July 2014 18:19, Michael Hunger notifications@github.com wrote:
Probably a overseen issue due to missing tests in this area. Since Neo4j 2.0 all graph operations require a transaction also for reading. So the GeoServer integration might have this issue in many more places. Not sure how to test the implementation of the GeoServer APIs (know too little about them).
Would you mind taking a look?
In most cases just putting a transactional block around the call is good enough. Like this:
try (Transaction tx = graphDb.beginTx()) { access code tx.success(); // mostly needed for write operations but also doesn't hurt for read ops }
The transaction is automatically closed when the try-block is closed.
— Reply to this email directly or view it on GitHub https://github.com/neo4j-contrib/spatial/issues/149#issuecomment-49336769 .
Simon Harrison Application Developer onefinestay
e. simon.harrison@onefinestay.com
5 St Johns Lane London EC1M 4BH
Perhaps the PR is a good opportunity for us to take a look, and get started with fixing this. Either by accepting the request and taking it from there, or by investigating a better way. Not sure when Michael, or I, or someone else will have time to look, but hopefully soon.
I've seen some chatter about this but no solution. Mac OS, Neo 2.1.2, Geoserver 2.5, Neo4j Spatial master. But I've tried many combinations of these tools.
There is a failing test that may indicate the case of this error.