Consider the following code: dao1 and dao2 use different DataSources
public void trans() { Trans.exec(new Atom(){ public void run(){ dao1.insert(...); dao2.insert(...); //Statement 1 //Other operations //Statement that may throw an exception 2 } }); }
Excuse me:
Statement 1 throws an exception. Will dao1 roll back?
Statement 2 throws an exception. Will dao1 and or dao2 roll back?
If the run method does not throw an exception, will dao1/dao2 be submitted successfully?
What happens if dao1 is submitted successfully and dao2 fails?
---------------------Unknown dividing line---------------
Answer of last issue:
@Param(..)Map map
Declare a Map parameter The entry method of nutz, to obtain req, resp and session, just declare the parameters