APIJSON icon indicating copy to clipboard operation
APIJSON copied to clipboard

能否根据方法(GET/HEAD/POST等)以及数据库类型或者datasource设置隔离级别

Open cxkun opened this issue 3 years ago • 3 comments

我需要连接多个数据源,且是不同的数据库,目前主要有tidb、sqlserver。 目前没有找到根据方法和数据库类型两个条件设置隔离级别的参数。

parser中只能根据方法设置 executor中只能根据数据库类型设置

有没有什么方法能同时根据方法、数据库类型设置隔离级别

cxkun avatar Feb 23 '22 08:02 cxkun

目前可以重写方法自定义实现。 DemoSQLExecutor 重写 begin 或 getConnection https://github.com/Tencent/APIJSON/blob/master/APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java#L1037

TommyLemon avatar Feb 26 '22 07:02 TommyLemon

DemoSQLExecutor 中的begin或者getConnection无法判断当前执行的 是get还是post方法吧? 我需要的是get方法隔离级别设置为read uncommit,其他的不变

cxkun avatar Feb 28 '22 08:02 cxkun

DemoSQLExecutor 中的begin或者getConnection无法判断当前执行的 是get还是post方法吧? 我需要的是get方法隔离级别设置为read uncommit,其他的不变

getConnection 内 config.getMethod 拿到方法,用于判断 https://github.com/Tencent/APIJSON/blob/master/APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java#L1015

TommyLemon avatar Mar 07 '22 15:03 TommyLemon