Skip to content
New issue

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

OceanBase多数据源下无法正确识别 #758

Closed
RenYueHD opened this issue Jul 10, 2023 · 2 comments
Closed

OceanBase多数据源下无法正确识别 #758

RenYueHD opened this issue Jul 10, 2023 · 2 comments

Comments

@RenYueHD
Copy link

  • [✓ ] 我已在 issues 搜索类似问题,并且不存在相同的问题.

我的项目中需要同时使用oceanbase的mysql模式和oracle模式 在我配置了动态数据源并使用PageAutoDialect分别注册了oceanbase:oracle=OracleDialect,oceanbase=MysqlDialect后,PageAutoDialect的fromJdbcUrl在识别url时并没有优先匹配oracle,而是优先匹配了mysql,因为该方法对dialectAliasMap的keySet进行循环时,keySet并不是按照我添加的顺序进行循环的,导致在这种场景下无法正确对oracle和mysql双模式的数据源进行分页,恳请优化

@abel533
Copy link
Collaborator

abel533 commented Jul 10, 2023

如果和顺序有关,dialectAliasMap换LinkedHashMap能否解决?可以来个PR。

@RenYueHD
Copy link
Author

RenYueHD commented Jul 10, 2023

如果和顺序有关,dialectAliasMap换LinkedHashMap能否解决?可以来个PR。

map的keySet返回的是Set 而java的Set接口并不保证排序 所以不应该用 需要单独建立一个List来存储key来循环
但不知道是否有更好的办法

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants