• Post Reply Bookmark Topic Watch Topic
  • New Topic

Losing context during my integration test of database

 
Brian Storenson
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to write an integration test that queries an hsql database. I'm using hibernate/spring. My program seems to throw up on line 68. When I highlight query.getResultList() while I am debugging the test, it says:

query.getResultList() = >Exception occurred in target VM: org.hibernate.SessionException: Session is closed!<

It seems like I am losing the context. How do I reopen the transaction, or keep the transaction open so I can query the database?

Here is my stack trace



Here is my integration test

 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!