Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Rollback of sdn4.2 transactions fail in integration test [DATAGRAPH-967] #1531

Closed
spring-projects-issues opened this issue Feb 22, 2017 · 1 comment

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Feb 22, 2017

Roland Szűcs opened DATAGRAPH-967 and commented

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 [org.neo4j.ogm.session.Neo4jSession@74cf8b28] 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 [org.neo4j.ogm.session.Neo4jSession@74cf8b28]

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.springframework.test.context.transaction.TransactionalTestExecutionListener@3e57cd70] to process 'after' execution for test: method [public void hu.bookandwalk.RepositoryTests.ShouldInsertUser()], instance [hu.bookandwalk.RepositoryTests@718607eb], 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


Affects: 4.2 GA (Ingalls)

Reference URL: http://stackoverflow.com/questions/42366011/integration-test-of-neo4j-in-spring-boot-fails-to-rollback-the-inserted-object-n?noredirect=1#comment71907431_42366011

Backported to: 4.2.8 (Ingalls SR8)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant