polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "zhuangmz08" <zhuangm...@qq.com>
Subject UnitOfWork Exception handling?Usecase ?
Date Mon, 18 Apr 2016 06:51:17 GMT
Hi, 
I'm confused on exception handling inside unitofwork.
1. The following [Exception e] will never reached? because when I found duplicated entity,
the exception will not triggered until uow.complete(). However, after uow.complete(), it will
throw an exception for outter scope handler. Is this understanding correct?
How to handling this kind of exception.
2. What does Usecase mean here. When I have Usecases in the same name more than one time,
it doesn't throw any exception? 


public void test() throws Exception {
UnitOfWork uow = module.newUnitOfWork(newUsecase("blabla"));
try {
   entity = uow.newEntity(...);
} catch (Exception e) {
   // never reached????
}
uow.complete();
}


Thanks a lot.
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message