jdbc


Is neo4j-jdbc driver 3.x thread safe


I'm running a setup where I use a jdbc API installing neo4j-jdbc driver to connect to the neo4j database in VM, and I ran into a deadlock issue when doing some multi-thread works. I wonder if anyone knows if the neo4j-jdbc driver 3.x is thread safe or not?
Error Log
Exception: java.sql.BatchUpdateException: org.neo4j.driver.v1.exceptions.TransientException: LockClient[4211] can't wait on resource RWLock[NODE(2410), hash=1674994875] since => LockClient[4211] <-[:HELD_BY]- RWLock[NODE(2403), hash=1544505462] <-[:WAITING_FOR]- LockClient[4205] <-[:HELD_BY]- RWLock[NODE(2410), hash=1674994875]
org.neo4j.jdbc.bolt.BoltPreparedStatement.executeBatch(BoltPreparedStatement.java:178)
org.apache.commons.dbcp2.DelegatingStatement.executeBatch(DelegatingStatement.java:345)
org.apache.commons.dbcp2.DelegatingStatement.executeBatch(DelegatingStatement.java:345)
org.apache.beam.sdk.io.jdbc.JdbcIO$Write$WriteFn.finishBundle(JdbcIO.java:480)
Caused By: org.neo4j.driver.v1.exceptions.TransientException: LockClient[4211] can't wait on resource RWLock[NODE(2410), hash=1674994875] since => LockClient[4211] <-[:HELD_BY]- RWLock[NODE(2403), hash=1544505462] <-[:WAITING_FOR]- LockClient[4205] <-[:HELD_BY]- RWLock[NODE(2410), hash=1674994875]
org.neo4j.driver.internal.connector.socket.SocketResponseHandler.handleFailureMessage(SocketResponseHandler.java:71)
org.neo4j.driver.internal.messaging.PackStreamMessageFormatV1$Reader.unpackFailureMessage(PackStreamMessageFormatV1.java:464)
org.neo4j.driver.internal.messaging.PackStreamMessageFormatV1$Reader.read(PackStreamMessageFormatV1.java:425)
org.neo4j.driver.internal.connector.socket.SocketClient.receiveOne(SocketClient.java:130)
org.neo4j.driver.internal.connector.socket.SocketConnection.receiveOne(SocketConnection.java:143)
Stack trace truncated. Please see Cloud Logging for the entire trace.
The deadlock is a result of "normal" neo4j behavior in the presence of concurrent requests. You should be aware of neo4j's default locking behavior, and the documentation on deadlocks.
This may be the most helpful paragraph:
Experiencing frequent deadlocks is an indication of concurrent write
requests happening in such a way that it is not possible to execute
them while at the same time live up to the intended isolation and
consistency. The solution is to make sure concurrent updates happen in
a reasonable way. For example given two specific nodes (A and B),
adding or deleting relationships to both these nodes in random order
for each transaction will result in deadlocks when there are two or
more transactions doing that concurrently. One solution is to make
sure that updates always happens in the same order (first A then B).
Another solution is to make sure that each thread/transaction does not
have any conflicting writes to a node or relationship as some other
concurrent transaction. This can for example be achieved by letting a
single thread do all updates of a specific type.

Related Links

Jaybird (Firebird JDBC) absolute() method
Inserting data into Snowflake using JDBC
Jasper Server: The required driver class (oracle.jdbc.OracleDriver) is not found in uploaded files [duplicate]
How to load Impala table directly to Spark using JDBC?
How to add JScrollPane to JTable
Exception while running JUNIT with Spring JDBC Template, HSQL and Stored Procedure
Connect to a Local Oracle Database (LOCALHOST) from another System that is connected via lan
IllegalArgumentException: u'Wrong FS: file://spark-warehouse, expected: file:///'
How can I use SparkSession to select a subset of a postgre table but not to load full table?
JDBC connection lifecycle for Connection Pool (Hikari) reuse
how to use phoenix transaction with jdbc client
Jasperstarter: Unable to load driver
Error while connecting IBM Cognos 10.2.1 with Hive 0.11
Oracle JDBC call PL/SQL procedure with input parameter a table of records
How to read MS sql server for SparkR 2.0
Without calling Class.forName(“com.mysql.jdbc.Driver”) run program

Categories

HOME
python
paypal
jdbc
semantic-ui
angular-cli
paramiko
visual-studio-2013
agile
json-ld
playframework
phpstorm
is-empty
laravel-4
urlencode
dropbox
lagom
hashicorp-vault
finite-group-theory
image-recognition
mongodb-query
simple-injector
rebol2
opera-mini
rhapsody
redux-observable
google-openid
jcl
derived
jni
delete-file
rhmap
ui5
cep
unpack
spring-data-neo4j
reply
winscp
pep8-assembly
ivy
roundcube
percentage
apache-cloudstack
consumer
hawtio
text-files
strstr
installshield-2012
visualstudio.testtools
brute-force
parent
cgo
bayesian-networks
viewgroup
dojox.mobile
apiary
aqgridview
chown
dimple.js
pinvoke
jgraph
infinite-scroll
restivejs
settimeout
galleriffic
excon
tuxedo
jackson-databind
brython
search-regex
mfc-feature-pack
asp.net-mvc-2
fortran90
handlebars.java
unity5.3
registrykey
sevenzipsharp
playscape
pylearn
uptodate
ejabberd-saas
and-operator
ibmsbt
outline
sid
zipalign
baucis
java.util.date
driver-signing
image-zoom
stagefright
entity-framework-4.1
ftp4j
qtgui
fortran77
ubuntu-11.10
css-tables
qsqltablemodel
continuous-testing
selectonemenu
ajax.beginform
webkit-transform
windows-live-id
osx-leopard
surefire
clients
graniteds
windows-controls
kpi
nt4
odbc-sql-server-driver
project-lifecycle

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App