1
votes

When I specify a Isolation level other than the default in @Transactional, I get the error message stating that

JtaTransactionManager does not support custom isolation levels by default - switch 'allowCustomIsolationLevels' to 'true'

I am using spring data neo4j 3.2 running neo4j in embedded mode.

I am not able to find any documentation about how to achieve this. I am trying to workaround the lost-update and inconsistent analysis problem in a project.

The neo4j website suggests to use a locking node pattern (using java api) to achieve this.

I would appreciate any suggestion on how to implement this in SDN.

1
How do you setup your JtaTransaction manager? Do you extend Neo4jConfiguration class?František Hartman
yes. I am using annotation based configuration which extends from Neo4jConfigurationsdbrain

1 Answers

1
votes

You can enable allowCustomIsolationLevels by

@Configuration
...
public class MyNeo4jConfig extends Neo4jConfiguration {

...

@Override
public PlatformTransactionManager neo4jTransactionManager() throws Exception {
    JtaTransactionManager transactionManager = 
        new JtaTransactionManagerFactoryBean(this.getGraphDatabaseService()).getObject();
    transactionManager.setAllowCustomIsolationLevels(true);
    return transactionManager;
}