Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site migration is underway. Phase 2: migrate recent content

Transaction locks not working

Node Link


I've been trying to setup a lock mechanism with neo4j community and php ogm where 10 clients make write requests from a queue, using dbms.transaction.timeout=2s and dbms.lock.acquisition.timeout=20s (+info transaction management docs), in order to force a transaction to fail after 2 seconds it started, but stay waiting for the lock 10 seconds before failing.

But after a request fails by transaction timeout:

"The transaction has been terminated. Retry your operation in a new transaction, and you should see a successful result. The transaction has not completed within the specified timeout (dbms.transaction.timeout). You may want to retry with a longer timeout. "

All subsequent requests fail with this error:

"A transaction is already bound to this session"

I've tried setting really high timeouts to both variables (max 120s) but they always prematurely fail by the errors above.

Does anyone know where this problem might be coming from and how to fix it?

Thanks in advance,

José Ferreira


I would suggest to try it first without the OGM but plain cypher
I think the tx timeout is only checked if a tx is progressing, not when it's waiting for a lock.

dbms.transaction.timeout=2s and dbms.lock.acquisition.timeout=20s parameters can be set with Admin privileges' and cannot be enforced by clients but by Neo4j Database Administrators.
Thank you

Answer from the kernel team.
The tx timeout will have to wait until after the lock timeout during the lock waiting the tx timeout is not checked.

Alright, I'll try to experiment with plain cypher as you suggested, thanks for the help !