求大神帮忙解决hibernate报错问题谢谢啦
运行到Transaction tx = session.beginTransaction(); 这里时就报异常为:org.hibernate.TransactionException: nested transactions not supported 怎么回事啊,搞不懂了。其它就没问题
运行到Transaction tx = session.beginTransaction(); 这里时就报异常为:org.hibernate.TransactionException: nested transactions not supported 怎么回事啊,搞不懂了。其它就没问题
2016-11-12
public static void add(){
Grade grade = new Grade("java一班","个");
Student student1 = new Student("张三","男");
grade.getStudent().add(student1);
Session session =HiberUtil.getSession();
Transaction tx = session.beginTransaction();
session.save(student1);
System.out.println("fgdgdg");
session.save(student2);
tx.commit();
HiberUtil.closeSession(session);
}举报