Uploaded image for project: 'Spring Data Neo4j'
  1. Spring Data Neo4j
  2. DATAGRAPH-967

Auto Rollback of sdn4.2 transactions fail in integration test

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 4.2 GA (Ingalls)
    • CORE
    • Spring Boot 1.5.1, SDN 4.2 with STS 3.8.1 IDE. I use JUnit 4.12 for integration testing

    Description

      I wanted to test my SDN 4.2 repositories, specifically how to create new object/nodes. As this kind of integration tests are transactional ones, Spring automatically try to rollback the transactions.
      During the rollback I get an exception of org.neo4j.ogm.exception.TransactionManagerException: Transaction is not current for this thread.
      I used debug option for logging to see what's going on behind the scenes. The first relevant log item was:

      2017-02-21 12:11:18.941 DEBUG 5604 --- [           main] o.s.d.n.t.Neo4jTransactionManager        : Opened new Session [[email protected]] for Neo4j OGM transaction
      

      Later on:
      2017-02-21 12:11:19.559 DEBUG 5604 — [ main]

      o.s.d.n.t.Neo4jTransactionManager        : Rolling back Neo4j transaction [null] on Session [[email protected]]
      

      Finally I got a warning before the eception:

      2017-02-21 12:11:19.566  WARN 5604 --- [           main] o.s.test.context.TestContextManager      : Caught exception while allowing TestExecutionListener [org.springframew[email protected]3e57cd70] to process 'after' execution for test: method [public void hu.bookandwalk.RepositoryTests.ShouldInsertUser()], instance [[email protected]], exception [null]
      

      Consequently this test fail, although the @Test annotated method runs as expected delivering the expected result.

      Using transactional integration testing does not work

      Attachments

        Activity

          People

            nmervaillie Nicolas Mervaillie
            RollerBlade Roland Szűcs
            Archiver:
            tmarshall Trevor Marshall
            Spring Issues Spring Issues

            Dates

              Created:
              Updated:
              Resolved:
              Archived: