nutz, Come tonight (15): Does nutz support simultaneous rollback of multiple data sources? What are the limitations?

original
2015/01/15 22:59
Reading number 1.4K

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

Expand to read the full text
Loading
Click to join the discussion 🔥 (7) Post and join the discussion 🔥
Reward
seven comment
two Collection
zero fabulous
 Back to top
Top