Closed spring-projects-issues closed 7 years ago
Mark Angrish commented
Same problem. As explained here, this class has been patched for the user's application to correctly work: http://stackoverflow.com/questions/39696304/rollback-problems-with-new-neo4jtransactionmanager
kostas commented
Hi, I think this one should be upgraded to major since there are many cases that this can affect the workflow. E.g imagine the following scenario. I have a node with a unique constraint on property ``` id
I have a method that tries to create a node, it catches the unique constraint violation in case it is thrown from the underlying boltrequest, when it does it wants to continue the flow. But instead a NullPointerException is thrown because of this issue. So it breaks the functionality. *Currently the only workaround i could think of* is to avoid using the @Transactional in order to NOT at all use the Neo4jTransactionManager
@Transactional
(propagation = Propagation.REQUIRED, rollbackFor = java.lang.Exception.class)
public void createNode(Long id){
Node sampleNode=new Node(id);
sampleNode.setMyName("kostas");
try{
myNodeNeo4jRepository.save(sampleNode);
}catch(ClientException ex){
if (exception.getMessage() != null && exception.code().equals("Neo.ClientError.Schema.ConstraintValidationFailed")) {
String msg = "A node with the same id already exists in neo4j ,uniqueId is:" + sampleNode.getId();
LOGGER.warn(msg, exception);
} else {
throw exception;
}
} }
public void mulithreadedLogicThatCreatesNodes(){
List\
Nicolas Mervaillie commented
Fixed in DATAGRAPH-997
Mark Angrish opened DATAGRAPH-952 and commented
I have a test which tests an exception is thrown for a data integrity violation.
The structure is essentially:
Whole test case is linked in the Reference URL:
Using versions: SDN
4.2.0-BUILD-SNAPSHOT
OGM:2.1.0
Exception:
Affects: 4.2 RC1 (Ingalls), 5.0 M1 (Kay)
Reference URL: https://gist.github.com/frant-hartm/eb54c6ca346f4c5cee2636a1bbead404
Backported to: 4.2.8 (Ingalls SR8)
3 votes, 5 watchers