ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From J S <sharpfel...@yahoo.ca>
Subject Re: Mapper behaving differently between Eclipse and Maven
Date Sun, 21 Feb 2010 04:27:30 GMT
Found the problem, it was in my code (rookie's mistake, I guess).  I'll explain what I did
wrong, in case somebody else travels down this path.

In my design, I have a class called "SessionManager" which dispenses SqlSession instances
on a per-thread basis.  This allows multiple DAOs to use the same opened session without
having to explicitly pass the session around as a parameter on every operation (provided all
the operations are invoked within the same thread).  I was using this same mechanism in my
unit tests, which produced the odd results I observed when running the tests via Maven (don't
know exactly why).  To fix the problem, I modified my test setup by injecting a SessionManagerStub
to each Dao being tested; this stub contains a pristine SqlSession for each test being ran. 


Regards...



      __________________________________________________________________
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites.
Download it now
http://ca.toolbar.yahoo.com.
Mime
View raw message