apache / apache/grails-core

Transactions resulting in OptimisticLockingExcepetion are never committed nor rolled back

Open
#14,551 1 comment 0 reactions 0 assignees View on GitHub
relates-to: gorm
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

When OptimisticLockingException are thrown during session.flush() as part of doCommit(), it has been observed that those transactions are not rolled back and are left open and Neo4j server keep those transaction alive, and keeping any locks on objects as well. There so no default transaction timeout in Neo4j, hence resulting in complete lock till restart.

https://github.com/spring-projects/spring-framework/blob/master/spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java#L128 seems that we should set that to true in Neo4jDatastoreTransactionManager to handle roll backs during commit failures.

Contributor guide

Open the contributing guide

Research direction

Start by reading the referenced AbstractPlatformTransactionManager section and locating Neo4jDatastoreTransactionManager in the Grails codebase. Reproduce a session.flush() OptimisticLockingException during doCommit(), then verify that the transaction is rolled back or closed and Neo4j locks are released.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, neo4j, spring
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.