今天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. [转]BLAS简介

    BLAS(Basic Linear Algebra Subprograms)是一组线性代数计算中通用的基本运算操作函数集合[1] .BLAS Technical (BLAST) Forum负责规范BL ...

  2. 经典的sql语句,将返回结果合并为一个字符串

    declare @ts varchar(999) select @ts=isnull(@ts+',','')+name from sysobjects where xtype='U' select @ ...

  3. 第三部分:Android 应用程序接口指南---第二节:UI---第十一章 样式和主题

    第11章 样式和主题 style是用于指定View或window的外观和格式的一系列属性的集合.style可以指定高(height).填补(padding).字体颜色.字体大小.背景颜色等等属性.st ...

  4. 物联网架构成长之路(11)-Redis缓存主从复制

    1. 说明 在我的物联网平台框架框架中,会用到Redis这个中间件.作为EMQ权限认证的缓存.https://www.cnblogs.com/think-in-java/p/5123884.html ...

  5. CHKDSK/f

    chkdisk c: /f

  6. golang_elasticsearch 多精确值匹配

    问题 比如要查找属于两种类型的物品,这个时候,term查询就不行了,需要采用terms查询. golang中的用法 看了一下,olivere/elastic 包提供了一个 terms查询,于是高兴的直 ...

  7. app嵌入的H5页面的数据埋点总结

    好久没写博客了,大半年时间花费在了许多杂事上. 最近1个月专门为H5页面的app开发了一些埋点功能,主要是考虑到以后的可复制性和通用型,由于不是前端开发出身,相对来说还是比较简陋的. 正题开始:H5页 ...

  8. Hive数据倾斜解决办法总结

    数据倾斜是进行大数据计算时最经常遇到的问题之一.当我们在执行HiveQL或者运行MapReduce作业时候,如果遇到一直卡在map100%,reduce99%一般就是遇到了数据倾斜的问题.数据倾斜其实 ...

  9. 【C】——实现tree命令

    在大部分的linux系统中有一个很好用的命令——tree,就是显示目录的结构,但是发现在FreeBSD中没有这个命令,因此自己实现了一个简单的tree.代码如下:主要利用了递归的思想. #includ ...

  10. mininet下建立拓扑时关于远程控制器的一个小问题

    最近重装了系统和mininet后,使用mininet时遇到了一点小问题,一开始忽视了细节,使得自己被这个问题困扰了好一会儿,好在后来还是发现了问题所在,故记录下来. $ sudo mn --topo ...