admin管理员组

文章数量:1566354

报文:

### Error querying database.  Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'WMS_Inventory_View'.
### The error may exist in file [E:\workspace\clone\oumengcrm\oumeng-biz\oumeng-biz-wms\target\classes\mapping\ProudctMapper.xml]
### The error may involve cn.com.oumeng.biz.wms.mapper.ProductMapper.queryInventoryKL-Inline
### The error occurred while setting parameters
### SQL: select * from WMS_Inventory_View where 1=1                       and sku = ?
### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'WMS_Inventory_View'.
; bad SQL grammar []; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'WMS_Inventory_View'.] with root cause
com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'WMS_Inventory_View'.

项目背景

通过苞米豆baomidou的@DS注解来实现配置动态数据源的

产生问题原因

在方法上使用了 @Transactional 注解 ,导致了事务内数据源锁定 无法切换

解决

使用 @DSTransactional 注解

本文标签: jdbcsqlserverMicrosoftobjectInvalid