After a lot of tries, I decided to change my approach to solve this problem. I defined programmatically a new SqlSessionFactory, generating a new SqlSession with the Batch Executor and I used that one. Since it is an entirely different SqlSessionFactory, it seems it doesn't give problem if I use 2 differents ExecutorType. Here a sample working code:
Environment environment = new Environment("TEST", new JdbcTransactionFactory(), dataSource);
Configuration configuration = new Configuration(environment);
configuration.addMappers("com.mdv.dao");
SqlSessionFactory ssf = new SqlSessionFactoryBuilder().build(configuration);
SqlSession sqlSession = ssf.openSession(ExecutorType.BATCH);
try {
StagingFileMapper sfm = sqlSession.getMapper(StagingFileMapper.class);
for(Record r : staging){
StagingFile sf = new StagingFile();
//set your sf fields
sfm.insert(sf);
}
sqlSession.commit();
} catch (Exception e) {
//manage exception
}
finally{
sqlSession.close();
}