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

是不是这里的问题

阅读 9.3k
3 个回答

这是连接数据源错误么

这是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管理的,最好把配置文件贴出来 ~

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题