简体   繁体   English

如何减少mybatis-spring xml文件的扫描时间?

[英]How to decrease mybatis-spring xml files scan time?

We have a web application contains about more than 400 SQLMap XML files, and it takes about 80 seconds to start up the application. 我们有一个Web应用程序,其中包含大约400多个SQLMap XML文件,启动该应用程序大约需要80秒。 According to profiling and log result, most of cost is scanning XML files in the jars. 根据分析和记录结果,大部分成本是扫描jars中的XML文件。

Is any way to decrease scan time of XML files? 有什么方法可以减少XML文件的扫描时间?

If this is an option for you, you can disable scanning and tell MyBatis where to find the files, instead of letting it looking for them. 如果您选择这个选项,则可以禁用扫描功能,并告诉MyBatis在哪里找到文件,而不是让它查找文件。 This means adding XML configuration for mappers . 这意味着为映射器添加XML配置。

I see you have tagged the question "spring", so see if these two links apply to your setup: Registering a mapper and SqlSessionFactoryBean . 我看到您已标记问题“ spring”,因此请查看以下两个链接是否适用于您的设置: 注册一个映射器SqlSessionFactoryBean

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM