hibernate中: is not valid without active transaction
来源:互联网 发布:php object to json 编辑:程序博客网 时间:2024/06/07 09:06
Session session= sf.getCurrentSession();
Teacher t = (Teacher)session.get(Teacher.class,2);
System.out.println(t.getId());
Teacher t2 = (Teacher)session.load(Teacher.class, 1);
System.out.println(t2.getName());
session.getTransaction().commit();
会报错,把sf.openSession()就不报错了,openSession()每一次都产生一个新的session
- hibernate中: is not valid without active transaction
- org.hibernate.HibernateException: createSQLQuery is not valid without active transaction
- hibernate错误:load is not valid without active transaction
- org.hibernate.HibernateException: delete is not valid without active transaction
- Hibernate SessionFactory getCurrentSession is not valid without active transaction
- org.hibernate.HibernateException: save is not valid without active transaction
- org.hibernate.HibernateException: createSQLQuery is not valid without active transaction
- org.hibernate.HibernateException: save is not valid without active transaction
- createQuery is not valid without active transaction
- getFlushMode is not valid without active transaction
- createQuery is not valid without active transaction
- createQuery is not valid without active transaction
- getHibernateFlushMode is not valid without active transaction;
- getFlushMode is not valid without active transaction
- org.hibernate.HibernateException: save is not valid without active transaction at org.hibernate.co
- spring 管理 hibernate 事务 load is not valid without active transaction
- spring声明式管理事务+ hibernate + save is not valid without active transaction
- ssh整合报错org.hibernate.HibernateException: createQuery is not valid without active transaction
- 发帖水王
- sql server 2005学习笔记之触发器简介
- WCF服务访问超时的问题
- NanoBSD
- 【转】创建和使用Android library工程
- hibernate中: is not valid without active transaction
- netstat下time_wait数过多引起的问题
- MySQL 中文显示乱码
- 最近面试的问题
- MD2模型结构解释
- UDP用打洞技术穿透NAT的原理与实现
- Fedora14安装配置手记
- linux socket的select函数例子
- Facebook的Like按钮和社交插件到底有多牛,自己看!