Hello,
 I'm trying to understand the problems/issues of using multiple DaoManagers in 
the same application.

Say I have 2 jars:
MyApp.jar
TheirLib.jar

Both use Ibatis DAO. So, somewhere in their initialization, each makes a call 
to DaoManagerBuilder.buildDaoManager(...) and keeps their DaoManager instance 
somewhere.

If in a thread I call a method that uses the daomanager of MyApp and in the 
same method I use the daomanager of TheirLib, won't the first commit of the 2 
commit everything?

ie:
// Code in MyApp.jar
public void testMethod() {
 daoManager_.startTransaction();
 try{
   doSomethingWithTheAppDaos();
   TheirLibMethod(); <--- Somewhere in here there is a 
theirLibDaoManager.commitTransaction();
   daoManager_.commitTransaction();
 }
 finally {
   daoManager.endTransaction();
 }
}

Since the contexts/transactions are kept in the TLS (thread local storage) 
doesn't multiple daomanager instances step on eachother (as long as they are 
used in the same thread)?

Thanks
Louis


Reply via email to