WlExop
2017-06-15 02:34使用ssh框架做新增功能时无法将数据写入数据库
在spring配置文件中配置了事务管理
</context:component-scan
而且在类上面也开启了事务注解:
import javax.transaction.Transactional;
import com.dao.YongHuDao;
import com.entity.YongHu;
import com.service.YongHuService;
@Transactional
public class YongHuServiceImpl implements YongHuService {
private YongHuDao yhdi;
@Override
public void add(YongHu t) {
yhdi.add(t);
}
控制台没有错误信息,只输出一条查询伪表id的sql语句:
DEBUG - Found thread-bound Session for HibernateTemplate
DEBUG - trace com.mchange.v2.resourcepool.BasicResourcePool@58aff4cd managed: 3, unused: 2, excluded: 0
Hibernate:
select
hibernate_sequence.nextval
from
dual
DEBUG - Not closing pre-bound Hibernate Session after HibernateTemplate
hahahhaah26hahahahhahha
DEBUG - Entering nullPropertyValue [target=[com.entity.YongHu@2e81070, com.action.UserAction@3e625613, com.opensymphony.xwork2.DefaultTextProvider@17e36931], property=struts]
DEBUG - Entering nullPropertyValue [target=[com.entity.YongHu@2e81070, com.action.UserAction@3e625613, com.opensymphony.xwork2.DefaultTextProvider@17e36931], property=org]
DEBUG - after Locale=zh_CN
实在找不出哪里错了,求大神解答
- 点赞
- 回答
- 收藏
- 复制链接分享
3条回答
为你推荐
- 使用ssh框架做新增功能时无法将数据写入数据库
- 数据库
- ssh
- 3个回答