在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
实在找不出哪里错了,求大神解答