Spring Data Neo4j:由回滚异常覆盖的应用程序异常

时间:2016-01-26 15:28:43

标签: java spring neo4j spring-data-neo4j-4 neo4j-ogm

我有一个很长的事务,当发生异常时,Web应用程序仍在工作,但是如果我调用某些涉及db(通过REST远程)的操作,则该操作需要很长时间才能失败。

INFO  [org.springframework.data.neo4j.config.Neo4jConfiguration] Intercepted exception
ERROR [org.springframework.transaction.interceptor.TransactionInterceptor] Application exception overridden by rollback exception

当它尝试执行回滚时,它无法完成操作,因为服务器没有响应

public class TransactionManager {
....
    private HttpResponse executeRequest(HttpRequestBase request) {
        ...
        HttpResponse response = httpClient.execute(request); // not respond
你能帮帮我吗? 谢谢

1 个答案:

答案 0 :(得分:2)

假设您使用SDN 4。 请升级使用neo4j-ogm 1.1.5-SNAPSHOT并重新测试。 它包含了该区域的一些修复。

  <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-ogm</artifactId>
        <version>1.1.5-SNAPSHOT</version>
  </dependency>

您还需要包含

        <repository>
            <id>neo4j-snapshots</id>
            <url>http://m2.neo4j.org/content/repositories/snapshots</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>