解决方案 »
- Cannot create a session after the response has been committed
- Hibernate annotation ManyToMany的中间表加入自己的字段存储报错
- 关于Struts2 中,表达式使用问题
- 不能加载验证配置文件
- struts应用中报HTTP Status 404错
- 大侠们救命log4j的问题,不产生备份文件
- hibernate+log4j
- eclipse和myeclipse有什么联系和区别?
- 高分请教J2EE项目在企业内网实现问题?
- 怎样使java做的applet象浮动广告那样浮动在页面上?????急急急
- 开源一个Excel数据导入导出工具
- tomcat启动报的这个是什么意思?关于APR的,,,,,,
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;public class CommonDao extends SqlSessionDaoSupport {
@Resource
public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
super.setSqlSessionFactory(sqlSessionFactory);
}
}
[com.ssmm.dao.UserMapper.selectByPrimaryKey]==> Preparing: select id, username, password, age from user where id = ?
[com.ssmm.dao.UserMapper.selectByPrimaryKey]==> Parameters: 91(Integer)
[com.ssmm.dao.UserMapper.selectByPrimaryKey]<== Total: 1
[org.mybatis.spring.SqlSessionUtils]Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4ccd32f4]
684
[org.mybatis.spring.SqlSessionUtils]Fetched SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4ccd32f4] from current transaction
[com.ssmm.dao.UserMapper.insert]==> Preparing: insert into user (id, username, password, age) values (?, ?, ?, ?)
[com.ssmm.dao.UserMapper.insert]==> Parameters: 236(Integer), 6(String), 6(String), 6(Integer)
[com.ssmm.dao.UserMapper.insert]<== Updates: 1
[org.mybatis.spring.SqlSessionUtils]Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4ccd32f4]
[org.mybatis.spring.SqlSessionUtils]Fetched SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4ccd32f4] from current transaction
[com.ssmm.dao.UserMapper.deleteByPrimaryKey]==> Preparing: delete from user where id = ?
[com.ssmm.dao.UserMapper.deleteByPrimaryKey]==> Parameters: 91(Integer)
[com.ssmm.dao.UserMapper.deleteByPrimaryKey]<== Updates: 1
[org.mybatis.spring.SqlSessionUtils]Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4ccd32f4]
[org.springframework.jdbc.datasource.DataSourceTransactionManager]Participating transaction failed - ing existing transaction as rollback-only
[org.springframework.jdbc.datasource.DataSourceTransactionManager]Setting JDBC transaction [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@2eb9eee9] rollback-only
[org.mybatis.spring.SqlSessionUtils]Transaction synchronization deregistering SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4ccd32f4]
[org.mybatis.spring.SqlSessionUtils]Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4ccd32f4]
[org.springframework.jdbc.datasource.DataSourceTransactionManager]Initiating transaction rollback
[org.springframework.jdbc.datasource.DataSourceTransactionManager]Rolling back JDBC transaction on Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@2eb9eee9]
[org.springframework.jdbc.datasource.DataSourceTransactionManager]Releasing JDBC Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@2eb9eee9] after transaction
[org.springframework.jdbc.datasource.DataSourceUtils]Returning JDBC Connection to DataSource
[org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver]Resolving exception from handler [public com.ssmm.model.User com.ssmm.controller.UserController.showOneUser(int)]: java.lang.RuntimeException
[org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver]Resolving exception from handler [public com.ssmm.model.User com.ssmm.controller.UserController.showOneUser(int)]: java.lang.RuntimeException
[org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver]Resolving exception from handler [public com.ssmm.model.User com.ssmm.controller.UserController.showOneUser(int)]: java.lang.RuntimeException
[org.springframework.web.servlet.handler.SimpleMappingExceptionResolver]Resolving exception from handler [public com.ssmm.model.User com.ssmm.controller.UserController.showOneUser(int)]: java.lang.RuntimeException
[org.springframework.web.servlet.handler.SimpleMappingExceptionResolver]Resolving to default view 'error' for exception of type [java.lang.RuntimeException]
[org.springframework.web.servlet.handler.SimpleMappingExceptionResolver]Exposing Exception as model attribute 'exception'
[org.springframework.web.servlet.DispatcherServlet]Handler execution resulted in exception - forwarding to resolved error view: ModelAndView: reference to view with name 'error'; model is {exception=java.lang.RuntimeException}
java.lang.RuntimeExceptionInitiating transaction rollback已经回滚太感谢了。。
我心中还有个疑惑,我继承的SqlSessionDaoSupport 和我 注入的 <bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate"> 有什么本质上的区别吗,请大神指教。
Initiating transaction rollback已经回滚太感谢了。我心中还有个疑惑,我继承的SqlSessionDaoSupport 和我 注入的 <bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate"> 有什么本质上的区别吗,请大神再指教下
http://5880861.blog.51cto.com/5870861/1544168还是万分感谢你关注我的问题,谢谢
http://5880861.blog.51cto.com/5870861/1544168还是万分感谢你关注我的问题,谢谢你可以把CommonDao作为Controller的属性使用@Autowire来注入.
Initiating transaction rollback已经回滚太感谢了。我心中还有个疑惑,我继承的SqlSessionDaoSupport 和我 注入的 <bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate"> 有什么本质上的区别吗,请大神再指教下
如果是单例的,那么都是在spring容器启动的时候初始化, 没什么本质区别
http://bbs.csdn.net/topics/390904063
我的新问题,有兴趣的大大,帮忙看看。