What actuator Mybatis there?

Mybatis There are three basic Executor executor:

          SimpleExecutor、ReuseExecutor、BatchExecutor。

SimpleExecutor: Each time update or select, just open a Statement object, run out immediately closed Statement object.

ReuseExecutor: execute update or select, as a key to find sql Statement object exists on the use, it does not exist to create, after use, do not close the Statement object, but placed in the Map, for the next use. In short, re-use Statement objects.

BatchExecutor: execute update (not select, JDBC does not support batch select), all sql are added to the batch (addBatch ()), waiting for the uniform implementation (executeBatch ()), it caches multiple Statement objects, each Statement objects are addBatch () after completion, waiting for execution one by one executeBatch () batch. And JDBC same batch.

Scope: Executor of these features are strictly limited in scope SqlSession life cycle.

Mybatis how to specify which one to use Executor executor?

A: Mybatis configuration file, you can specify the default ExecutorType actuator type, you can manually create a method to transfer ExecutorType SqlSession of DefaultSqlSessionFactory type parameters.

Guess you like

Origin www.cnblogs.com/jxxblogs/p/12150432.html