Announcement Announcement Module
Collapse
No announcement yet.
OpenSessionInViewInterceptor and unit tests Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • OpenSessionInViewInterceptor and unit tests

    I'm currently facing a problem with the OpenSessionInViewInterceptor, my unit tests don't have a session. I like the simplicity OpenSessionInViewInterceptor provides and I'm looking for suggestions.

  • #2
    I found http://forum.springframework.org/showthread.php?t=10543 and the suggestions seem to almost work. It doesn't commit...

    Cheers,
    Dan
    Last edited by robyn; May 14th, 2006, 10:04 AM.

    Comment


    • #3
      Here (http://forum.hibernate.org/viewtopic.php?t=929167) is another post about the same thing. This seems to be a reasonably common problem with no easy solution...

      Comment


      • #4
        Really, I think the 'easy' solution is to run your unit tests in a transaction. I use TransactionTemplate myself.

        If the code runs transactionally in real life, why shouldn't it run transactionally in a test?

        Comment

        Working...
        X