The value of the primary key [id] of the insert data obtained under the mybatis transaction

now has a requirement: Table A The data of Table B needs to be manipulated in 同一个事务. Table A bid holds the id of Table B.

表 A: id[primary key] , name , bid [primary key of table B]

表 B: id[primary key] , name

is the first insert table B After getting the primary key, assign the id to the bid and then the table Ainsert.

After verifying various online modification methods, I found that only one can implement this function:

修改mybatis-config.xml File

<!-- For bulk update operation cache SQL to improve performance BATCH changed to SIMPLE -->
<setting name="defaultExecutorType" value="SIMPLE" />

Change BATCH to SIMPLE . Will it affect other places for the time being?