今天yuan男神的程序报了这个错,

 getHibernateTemplate().saveOrUpdate(obj);
getHibernateTemplate().flush();
getHibernateTemplate().refresh(obj);

在第2行报的:

org.hibernate.HibernateException: connnection proxy not usable after transaction completion

以为是hibernate事务的问题,还考虑了懒加载的原因,后来男神发现,是数据库的字段类型为int,实体类的字段类型是Date,这个字段应该是date类型的,save的时候也存放的是date类型,男神把库里的类型改成日期了,就OK啦。

org.hibernate.HibernateException: connnection proxy not usable after transaction completion的更多相关文章

  1. Exception in thread "main" org.hibernate.HibernateException: save is not valid without active transaction

    在spring4+hibernate4整合过程中,使用@Transactional注解事务会报"Exception in thread "main" org.hibern ...

  2. 报错HTTP Status 500 - HHH000142: Javassist Enhancement failed: cn.itcast.entity.Customer; nested exception is org.hibernate.HibernateException: HHH000142: Javassist Enhancement failed: cn.itcast.entity.

    报错 type Exception report message HHH000142: Javassist Enhancement failed: cn.itcast.entity.Customer; ...

  3. SSH dao层异常 org.hibernate.HibernateException: No Session found for current thread

    解决方法: 在 接口方法中添加 事务注解 即可. public interface IBase<PK extends Serializable, T> { @Transactional v ...

  4. spring整合hibernate的时候报异常org.hibernate.HibernateException: createQuery is not valid without active transaction

    在整合Spring4+hibernate4时候,当代码执行到dao中CRUD操作时,报了一个异常, org.hibernate.HibernateException: createQuery is n ...

  5. org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here

    org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not a ...

  6. org.hibernate.HibernateException: No Session found for current thread

    spring.springmvc和hibernate整合 在sessionFactory.getCurrentSession()时,出现以下异常 No Session found for curren ...

  7. org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance:

    详细错误堆栈信息: org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" ...

  8. 问题Initial SessionFactory creation failed.org.hibernate.HibernateException: /hibernate.cfg.xml not found解决方法

    问题Initial SessionFactory creation failed.org.hibernate.HibernateException: /hibernate.cfg.xml not fo ...

  9. 使用hibernate时出现 org.hibernate.HibernateException: Unable to get the default Bean Validation factory

    hibernate 在使用junit测试报错: org.hibernate.HibernateException: Unable to get the default Bean Validation ...

随机推荐

  1. JmsTemplate sendAndReceive 设置超时

    通过调用sendAndReceive方法,实现发送消息之后可以同步接收返回信息. Message replyMsg = this.jmsQueueTemplate.sendAndReceive(new ...

  2. JMX-Java Management Extensions

    JMX全称Java Management Extensions, 为Java应用提供管理扩展功能.在Java 5的时候引入 概念 Name Description MBean 全称为Managed B ...

  3. Scale-out NAS 和scale-up NAS 系统的优缺点

    企业IT部门在应对非结构化数据的爆炸性增长时,他们需要考虑选购适合的NAS系统,决定传统的固定容量的NAS设备和新兴的scale-out NAS设备哪一种能更好地满足他们的文件存储需求. 为了帮助你做 ...

  4. springboot本地读取resources/images没问题,上传到云服务器打成jar包就读取不到问题

    //String watermarkfileName = this.getClass().getClassLoader().getResource("images/watermark.png ...

  5. Swift 栈和堆

    前言 Swift 中的数据类型分为引用类型(类)和值类型(枚举.结构体). 引用类型存储在 "堆" 上,值类型存储在 "栈" 上. Swift 管理引用类型采用 ...

  6. google全球地址

    IP Addresses of Google Global Cache www.kookle.co.nr Bulgaria 93.123.23.1 93.123.23.2 93.123.23.3 93 ...

  7. 深入理解C++中public、protected及private用法

    深入理解C++中public.protected及private用法   这篇文章主要介绍了C++中public.protected及private用法,对于C++面向对象程序设计来说是非常重要的概念 ...

  8. MAC OS X显示.开头的文件_苹果操作系统显示隐藏文件命令

    转自:http://dditblog.com/blog_446.html 今天在导入Eclipse项目的时候.发现导入不了.初步估计是因为项目没有.project的文件.在Mac OS X操作系统下面 ...

  9. CentOS5.x、CentOS6.x 使用NFS及mount实现两台服务器间目录共享

    一.环境介绍: 服务器:centos 192.168.1.225 客户端:centos 192.168.1.226 二.安装: NFS的安装配置:centos 5 : portmap:实现RPC(协议 ...

  10. eBGP&iBGP 总结

    3.4 BGP 原文地址:http://mp.weixin.qq.com/s?src=3&timestamp=1500043305&ver=1&signature=XwiIVV ...