Home > database >  Mybatis in <update> written in multiple update statement, and separate written multiple <up
Mybatis in <update> written in multiple update statement, and separate written multiple <up

Time:09-16

For example:
Update 1... ;
Update 2... ;
Update 3... ;
And
Update 1... ;
Update 2... ;
Update 3... ;

What's the difference between the two? The first kind of their own affairs control?

CodePudding user response:

Update 1... ;
Update 2... ;
Update 3... ;
In the third article written before an illegal SQL to see whether the two rolled back

CodePudding user response:

reference 1st floor rucypli response:
& lt; The update id="updateByPrimary" & gt;
Update 1... ;
Update 2... ;
Update 3... ;
In the third article written before an illegal SQL to see whether the two roll back


This is TX control problems, such as Spring, TX, is responsible for, even if written in multiple completely unrelated processing, as long as it is under control a TX, the rollback or rolled back, and ibatis writing has nothing to do,

CodePudding user response:

refer to the second floor gikod response:
Quote: refer to 1st floor rucypli response:

Update 1... ;
Update 2... ;
Update 3... ;
In the third article written before an illegal SQL to see whether the two roll back


This is TX control problems, such as Spring, TX, is responsible for, even if written in multiple completely unrelated processing, as long as it is under control a TX, the rollback or rolled back, has nothing to do with the ibatis spelling,


Have tested? I don't feel the second writing have the transaction, if the spring do not add transaction control

CodePudding user response:

The first is no transaction

CodePudding user response:

General_log open, look at the mysql received what is the difference between the SQL

CodePudding user response:

This is no different, the only difference is the code readability
  • Related