title: Transaction manager for tests
body: <p>I have a simple transaction manager implementation and I am wondering how best to handle my end-to-end integration tests.</p>
  
  <p>In my test I invoke an action in my test which starts a transaction and does some work. As part of my test I want to do some assertions about the database work its done but I don't want to commit the transaction - I want to roll it back.</p>
  
  <p>One way I can think to achieve this would be to override the transaction manager and make the commit method do nothing and invoke rollback at the end of the test.</p>
  
  <p>One thing that concerned me with this approach is the caching that involved, how do I make sure that every action results in a database call rather than using any cache?</p>
  
  <p>I figure this must be something that has been answered before - no point in reinventing the wheel, so am I doing the right thing?</p>
  
  <p>If it matters, I am using Hibernate and NOT using Spring.</p>