最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

记一次com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name

运维笔记admin2浏览0评论

报文:

### 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 注解

发布评论

评论列表(0)

  1. 暂无评论