We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
具体建议在代码块注释中
private AbstractHelperDialect getDialect(MappedStatement ms) { //改为对dataSource做缓存 DataSource dataSource = ms.getConfiguration().getEnvironment().getDataSource(); /* 当使用TDDL时,获得的url是null,而urlDialectMap是ConcurrentHashMap类型 这种情况下,下面紧跟的urlDialectMap.containsKey(url)会导致NPE 因此,个人感觉应该把后面的if (StringUtil.isEmpty(url)) 校验放提前 */ String url = getUrl(dataSource); if (urlDialectMap.containsKey(url)) { return urlDialectMap.get(url); } try { lock.lock(); if (urlDialectMap.containsKey(url)) { return urlDialectMap.get(url); } if (StringUtil.isEmpty(url)) { throw new PageException("无法自动获取jdbcUrl,请在分页插件中配置dialect参数!"); } String dialectStr = fromJdbcUrl(url); if (dialectStr == null) { throw new PageException("无法自动获取数据库类型,请通过 helperDialect 参数指定!"); } AbstractHelperDialect dialect = initDialect(dialectStr, properties); urlDialectMap.put(url, dialect); return dialect; } finally { lock.unlock(); } }
The text was updated successfully, but these errors were encountered:
最新版本会增加接口允许自己实现动态获取dialect。
Sorry, something went wrong.
No branches or pull requests
功能建议
具体建议在代码块注释中
The text was updated successfully, but these errors were encountered: