首页 > spring和mybatis问题

spring和mybatis问题

2016-01-13 17:39:53 [org.mybatis.spring.SqlSessionUtils]-[DEBUG] Creating a new SqlSession
2016-01-13 17:39:53 [org.mybatis.spring.SqlSessionUtils]-[DEBUG] SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1442022] was not registered for synchronization because synchronization is not active
2016-01-13 17:39:53 [org.springframework.jdbc.datasource.DataSourceUtils]-[DEBUG] Fetching JDBC Connection from DataSource
2016-01-13 17:39:53 [org.mybatis.spring.transaction.SpringManagedTransaction]-[DEBUG] JDBC Connection [com.mysql.jdbc.JDBC4Connection@1bbd90e] will not be managed by Spring
2016-01-13 17:39:53 [com.bank.dao.ChannelMapper.searchChannel]-[DEBUG] ooo Using Connection [com.mysql.jdbc.JDBC4Connection@1bbd90e]
2016-01-13 17:39:53 [com.bank.dao.ChannelMapper.searchChannel]-[DEBUG] ==> Preparing: SELECT id,name FROM bankdb.t_channel where location not in (-1,1) and is_lock='是'
2016-01-13 17:39:53 [com.bank.dao.ChannelMapper.searchChannel]-[DEBUG] ==> Parameters:
2016-01-13 17:39:53 [com.bank.dao.ChannelMapper.searchChannel]-[DEBUG] <== Total: 0

出现这种问题导致获取不到数据,求大神解答呀

2016-01-13 17:39:53 [org.mybatis.spring.SqlSessionUtils]-[DEBUG] SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1442022] was not registered for synchronization because synchronization is not active
2016-01-13 17:39:53 [org.springframework.jdbc.datasource.DataSourceUtils]-[DEBUG] Fetching JDBC Connection from DataSource
2016-01-13 17:39:53 [org.mybatis.spring.transaction.SpringManagedTransaction]-[DEBUG] JDBC Connection [com.mysql.jdbc.JDBC4Connection@1bbd90e] will not be managed by Spring

是不是这里的问题


这是连接数据源错误么


2016-01-13 17:39:53 [org.mybatis.spring.transaction.SpringManagedTransaction]-[DEBUG] JDBC Connection [com.mysql.jdbc.JDBC4Connection@1bbd90e] will not be managed by Spring

应该是数据源不是Spring管理的,最好把配置文件贴出来 ~


这是spring事务未开启

【热门文章】
【热门文章】